09.06.2017.
Friday.
sass:
Syntactically Awesome StyleSheetsWith Sass, you can write clean, sustainable CSS code and solve the common repetition and maintenance challenges present in traditional CSS
Sass can't be directly interpreted by your browser, so it must first be converted, or compiled, to CSS before the browser can directly understand it.
Compiling refers to converting code to lower level code so that it can be executed. By compiling SCSS to CSS, it can be interpreted by your browser and the results will appear on a webpage.
Before we dive into writing Sass, let's first learn how to compile it to CSS by typing the following command in the terminal and pressing enter:
sass main.scss main.css
Nesting
Nesting is the process of placing selectors inside the scope of another selector:
css
.parent
{
color:blue;
}
.parent.child
{
font-size:12px;
}
scss
.parent{
color:blue;
.child
{
font-size:12px;
}
}
In SCSS, nesting is not limited only to selectors.
Sass data types
Number
String
Boolean
Null
Lists
Maps
Mixins
Their ability to take in arguments, assign default values to those arguments, and accept said arguments in whatever format is most readable and convenient for you makes the mixin Sass's most popular directive.
The
&
selector* is a Sass construct that allows for
expressive flexibility by referencing the parent selector when working
with CSS psuedo elements and classes.
No comments:
Post a Comment