Last active
August 29, 2015 14:06
-
-
Save vjwilson/746e3f9a159586a2c7af to your computer and use it in GitHub Desktop.
Sass Chops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
hsla "Hue Saturation Brightness" + opacity | |
modified BEM synatx: | |
top_level_component--substyle | |
& = "parent class" | |
*/ | |
.notification { | |
padding: 1em; | |
& + .notification { | |
margin: 1em; | |
} | |
.title & { | |
content: "title"; | |
} | |
} | |
// => | |
.notification + .notification{ | |
margin: 1em; | |
} | |
.title .notification { | |
content: "title"; | |
} | |
/* | |
Both mixins and extends allow you to reuse code | |
mixins are like functions that allow you to pass in variables | |
extends don't take variables and reuse code by chaining selectors | |
*/ | |
/* | |
functions: | |
define your own, or use one of the many pre-build functions | |
e.g, adjust color function | |
use just like a mixin | |
*/ | |
/* | |
SASS has conditionals | |
easiest one to use is | |
@if ( condition ) { | |
// do if true | |
} @else { | |
// do if false | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment