2018-10-21 12:13:22 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								title: Sass
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								---
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-05 23:25:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Sass (Syntactically awesome style sheets) is a preprocessor scripting language initially designed by Hampton Catlin that compiles CSS. It essentially brings the power of a standard programming language to your stylesheets. Sass files end with the `.scss`  file extension. 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-19 20:44:23 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								With Sass, you can make your CSS considerably more efficient. Some of its key features include:
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								-  **nesting** which allows you to order child elements inside of their parents on your stylesheet 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-  **mixins** which allow you to apply the same style to multiple elements without having to copy and paste  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-  **for**, **if** , and **else**  statements which allow you to apply styles only in specific conditions 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-  **partials** which allow you to take chunks of your CSS and import them into other `.scss`  stylesheets 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								-  **extend** which allows you to take the style from one element into another 
						 
					
						
							
								
									
										
										
										
											2018-12-19 20:44:23 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Store data with Sass variables
  
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								One of the main features of Sass is its ability to define variables. You can define variables for almost anything such as color, font, units, etc.
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Variables can be defined in Sass by using the `$`  and variable name. (e.g., if I want my website's theme color to be blue. I can write:
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$themeColor: blue; //defines theme color
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$baseFont: 14px; // defines font size
							 
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Now I can use the variable to set color in my website:
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								p {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  color: $themeColor;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  font-size: $baseFont;
							 
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								And it also makes it easier to change the theme color of my website without having to change the color *blue*  in every element style. I can simply change the variable value:
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								$themeColor: red; //changed the color from blue to red
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Nest CSS within SASS
  
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Another great feature of Sass is nesting. Nesting saves you from having to write too much code. If you have an element inside of another element, you don't have to write more lines of code to target the child element. It can be understood with and example.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Suppose you have a heading element inside of a div with a class of *parent* .
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```html
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< div  class = "parent" >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  < h1 > The heading< / h1 > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								< / div >  
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								In plain CSS, to style the *parent*  element and the heading inside of the *parent*  element, you have to write:
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```css
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								.parent {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  background: #e3e3e3 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  border: 1px solid #c1c3c1 ;
							 
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								.parent h1 {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  color: #333 ;
							 
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								But in Sass, you can nest one selector inside of the other:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								.parent {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  background: #e3e3e3 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  border: 1px solid #c1c3c1 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								   h1 {                       //nested inside .parent element
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								     color: #333 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								   }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								which would compile to:
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```css
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								.parent {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  background: #e3e3e3 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  border: 1px solid #c1c3c1 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								.parent h1 {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  color: #333 ;
							 
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-01 16:49:07 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Mixins
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Mixins are like functions for CSS. They allow you to break CSS down into modular chunks that can be reused anywhere in your stylesheets, and this helps us to avoid writing repetitive code. Mixins are created using the `@`  symbol and included in other rules using `@include` .
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								To create a mixin, use the `@mixin`  command followed by a space and the name of your mixin.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Example:
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 05:47:56 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								@mixin  box-shadow() {    
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  -webkit-box-shadow: 10px 10px 5px 0px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  -moz-box-shadow: 10px 10px 5px 0px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  -ms-box-shadow: 10px 10px 5px 0px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  box-shadow: 10px 10px 5px 0px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								You can now use your mixin like this:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								.mydiv{
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  @include  box-shadow();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Mixins can also take arguements. For example:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								@mixin  box-shadow($x,$y,$blur,$c){ 
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  -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;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								.mydiv {
							 
						 
					
						
							
								
									
										
										
										
											2018-10-24 08:57:08 +05:30 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  @include  box-shadow(0px,0px,5px,#fff );
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-01 16:49:07 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Extends
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								Sometimes you’ `@extend`  directive works like mixins in that you’ `@extend`  is useful for sharing sets of related properties that get repeated in your stylesheets, such as base styles for button sets.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 11:05:05 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Example 1:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
									
										
										
										
											2019-03-01 16:49:07 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								.btn--primary {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  background-color: #333 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  border-radius: 5px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  text-transform: uppercase;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								.btn--callout {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  @extend  .btn;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								.btn--info {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  @extend  .btn;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 11:05:05 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Example 2:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								%success {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  background-color:green;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  color:white;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								#myDiv {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  @extend  %success;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  font-size:10px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								#myOtherDiv {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  @extend  %success;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  font-size:20px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Both selectors(`#myDiv`  and `#myOtherDiv` ) will inherit properties from `%success` , while maintaining their own unique properties.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 03:41:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Functions
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Sass has built in functions which can be easily used to manipulate colors.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								### Darken + Lighten
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								The first argument contains the color, the second the percentage adjusted.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$heading-color
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								.nav-bar li {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  & .active {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    darken( $heading-color, 10% );
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  & :hover {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    lighten( $heading-color, 10% );
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Sass also provides control directives such as `@if` , `@for` , `@each`  and `@while` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								### @if
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								$boolean: true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								@if  $boolean 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  .header {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    display: block;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								@else  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  .header {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    display: none;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 11:05:05 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Operators
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Sass adds mathematical operators, such as +, -, *, / and % to CSS.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Example:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 03:41:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								```sass
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 11:05:05 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								#myDiv {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  height: 1920px / 480px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  width: 1080px * 2;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-06 01:00:44 +05:45 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Additional Resources
  
						 
					
						
							
								
									
										
										
										
											2019-03-09 11:05:05 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								-  [Official Sass website ](https://sass-lang.com/ )