Monday, April 22, 2019

simple Sass YAGNI mixin

This LESS would look like so in Sass:

mixin seaMonster() {
   background-color: #000000;
   color: #00FF00;
}
#cthulhu {
   width: 1000px;
   height: 1000px;
   @include seaMonster();
}

 
 

This has a how-to cheatsheet on the mixins of Sass!

 
 

Addendum 5/13/2019: What was I thinking??? YAGNI should really be DRY. Also, there needs to be a leading at symbol at mixin at the beginning of what is above. It should look like:

@mixin seaMonster() {
   background-color: #000000;
   color: #00FF00;
}
#cthulhu {
   width: 1000px;
   height: 1000px;
   @include seaMonster();
}

No comments:

Post a Comment