Sass Flashcards
Sass stands for…
Syntactically Awesome StyleSheets
Sass to CSS is
a language extension
what Sass does in a nutshell
adds features that aren’t available using basic CSS syntax
Sass makes it easier for…
developers to simplify and maintain the style sheets for projects
Sass is a…
preprocessor, it takes code written in Sass syntax and converts to basic CSS
With Sass you can…
create variables, nest CSS rules into others, import other Sass files
creates more compact, easier to read code
how many syntaxes available for Sass?
2:
- SCSS (sassy CSS)
- indented syntax or just Sass
SCSS
extension of CSS synatx. every valid CSS stylesheet is a valid SCSS file with the same meaning.
have .scss extension
Indented Sass
older syntax, uses indentation rather than brackets to indicate nesting of selectors,
newlines rather than semicolons to separate properties
have .sass extension
in Sass, variables start with
$ followed by the variable name
set style tag to use sass
nesting in Sass
parent {
child {};
}
a mixin in Sass is
a group of CSS declarations that can be reused throughout the stylesheet
use case for mixin
the treatment of box-shadow by different browsers has to be handled by prefixes like -webkit or -moz
implement mixin (box shadow example)
starts with @mixin then name (parameters optional)
{all the basic CSS code that you would have used}
@mixin box-shadow($x, $y, $blur, $c){ -webkit-box-shadow: $x $y $blur $c; -moz-box-shadow: $x $y $blur $c; -ms-box-shadow: $x $y $blur $c; box-shadow: $x $y $blur $c; }