3. What is Sass?
•SASS is a system that extends CSS and can make you
more efficient and make your CSS more organized.
•Serves as
Scripting language
Preprocessor for CSS
4. SASS has two main parts
•SassScript (.sass & .scss)
SassScript is a scripting language that extends the CSS syntax,
adding nested rules, variables, mixins.
•SASS CSS pre-processor
The pre-processor interprets your SassScript and produces well
formatted standard CSS.
5. SASS Syntax
body
font: 100% $font-stack
color: $primary-color
body {
font: 100% $font-stack;
color: $primary-color;
}
.sass
.scss
6. The process
•Write your SassScript
•Use CSS pre-processor to interpret your SassScript
•CSS files are produced by the pre‐processor (use
these in your website)
8. Variables
•Variables allow you to assign a value to an easy-to-
remember placeholder name
Works with hex values, strings of text, colors, numbers, boolean
values etc.
No more memorizing hex values!
18. Partials
•You can create partial Sass files that contain little
snippets of CSS that you can include in other Sass files.
•A partial is simply a Sass file named with a leading
underscore.
•Sass partials are used with the @import directive.
_buttons.scss
_navigation.scss
genaral.sass
@import "buttons", "navigation";
19. Arithmetic operations
•Sass has a handful of standard math operators like +, -, *,
/, and %
.main-article {
float: left;
width: 600px / 960px * 100%;
}