Sass
Sass
Awesome
Stylesheets)
What is SASS?
2
SASS and SCSS
Two available syntaxes
SASS SCSS
• HAML-style indentation • Semi-colon and bracket
• No brackets or syntax
semicolons, based on • Superset of normal
indentation CSS
• Less characters to type • Normal CSS is also
• Enforced valid SCSS
conventions/neatness • Newer and
recommended
3
SASS and SCSS
Two available syntaxes
5
You can also extend other CSS declarations
with
@extend Resulting CSS
.error{ .error, .seriousError
color: red; {
} color: red;
.seriousError } .seriousError
{ {
@extend .error; font-weight: bold;
font-weight: bold; }
}
6
Mixins are sets of reusable styles, almost
like methods in other languages
@mixin awesome-text{ Resulting CSS
font-size: 24px; p{
font-weight: bold; font-size: 24px;
color: blue; font-weight: bold;
} color: blue;
P }
{
@include awesome-text;
}
7
Mixins can also take parameters
10
Color operations
You can also do mathematic operations on
color values
• How this is computed
#010203 + #040506 = #050709
01 + 04 = 05
11
Thanks!
12