Skip to content

Instantly share code, notes, and snippets.

@vjwilson
Last active August 29, 2015 14:06
Show Gist options
  • Save vjwilson/746e3f9a159586a2c7af to your computer and use it in GitHub Desktop.
Save vjwilson/746e3f9a159586a2c7af to your computer and use it in GitHub Desktop.
Sass Chops
/*
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