SCSS: The Basics
First Things FirstSASS=SCSS. Sass is the name of the framework,while SCSS is basically the file extension nameused for Sa...
Why Use SCSS?1. Better Organization/Modularization of CSS files:
It is possible to break down CSS into different fileswithout using SCSS, but then:1. It will be a pain to manually concate...
I.e. SCSS Concatenates ModularizedFiles Automatically and ConvertsThem into Valid CSS Files
Why Use SCSS?2. Able to use Variables with CSSE.g. instead of copy-pasting the color #F89939 everywherewe need it, we do:/...
Using variables also means: no more Find andReplace String if we decide to change propertyvalues:/*Just change here:*/$yel...
I.e. SCSS Allows Use of Variablesthat Cuts Down Development Time
Why Use SCSS?3. Automatic minification of CSS files4. Able to use standard math operations (+, -, *, /,and %) with CSS5. A...
Everyone Has to Come OnboardE.g. Anthony writes this in his style.scss:$yellow: #ffce54;.button{background-color:$yellow;}...
Everyone Has to Come OnboardBhagaban doesnt use SCSS. Instead, he customizesdirectly on style.css:.button{font-size:10px;b...
Everyone Has to Come OnboardAnthony isnt aware of that particular change, andcontinues working off his style.scss:$yellow:...
Its Easy to Use SCSS NOW1. With Ruby already installed on Mac, all we needis:gem install sassgem install sass2. Instead of...
Its Easy to use SCSS NOW3. Let Sass watch over your file:sass --watchsass --watchstylesheets/scss/app.scssstylesheets/scss...
More ResourcesThe official tutorial on Sass homepage:http://sass-lang.com/tutorial.htmlCompass: sort of a add-on to Sass...
Questions?
Upcoming SlideShare
Loading in …5
×

Using scss-at-noisestreet

340 views

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
340
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Using scss-at-noisestreet

  1. 1. SCSS: The Basics
  2. 2. First Things FirstSASS=SCSS. Sass is the name of the framework,while SCSS is basically the file extension nameused for Sass. E.g. style.scss. They are often usedinterchangeably.SCSS files are just CSS files with a .scssextension, i.e. you can still write your old css inan .scss file.
  3. 3. Why Use SCSS?1. Better Organization/Modularization of CSS files:
  4. 4. It is possible to break down CSS into different fileswithout using SCSS, but then:1. It will be a pain to manually concatenate them intoone or two files2. If we do not concatenate them, and instead rely onthe @import directive, then we will be makingmany HTTP requests to load the respective CSS,thus increasing load time.
  5. 5. I.e. SCSS Concatenates ModularizedFiles Automatically and ConvertsThem into Valid CSS Files
  6. 6. Why Use SCSS?2. Able to use Variables with CSSE.g. instead of copy-pasting the color #F89939 everywherewe need it, we do:/* Define our custom orange color */$yellow: #ffd320;/* Use it anywhere */.box {border:1px solid $yellow;}div{background-color:$yellow;}
  7. 7. Using variables also means: no more Find andReplace String if we decide to change propertyvalues:/*Just change here:*/$yellow: #ffce54;/* And its reflected everywhere */.box {border:1px solid $yellow;}div{background-color:$yellow;}
  8. 8. I.e. SCSS Allows Use of Variablesthat Cuts Down Development Time
  9. 9. Why Use SCSS?3. Automatic minification of CSS files4. Able to use standard math operations (+, -, *, /,and %) with CSS5. Adjust colors within SCSS, e.g. darken($yellow,20%);6. Use arguments and functions, …And More.
  10. 10. Everyone Has to Come OnboardE.g. Anthony writes this in his style.scss:$yellow: #ffce54;.button{background-color:$yellow;}Which is converted into the following style.css:.button{background-color:#ffce54;}
  11. 11. Everyone Has to Come OnboardBhagaban doesnt use SCSS. Instead, he customizesdirectly on style.css:.button{font-size:10px;background-color:#ffce54;}
  12. 12. Everyone Has to Come OnboardAnthony isnt aware of that particular change, andcontinues working off his style.scss:$yellow: #ffce54;.button{color:#000;background-color:$yellow;}Which is converted to the following css:.button{color:#000;background-color:#ffce54;}...hence overwriting Bhagabans font-size:10px;without knowing it.
  13. 13. Its Easy to Use SCSS NOW1. With Ruby already installed on Mac, all we needis:gem install sassgem install sass2. Instead of editing a CSS file, we now edit a .SCSSfile. Either I pass you the SCSS file I started off,or you can simply save your CSS file with .SCSSextension. (Every valid CSS rule is valid SCSS, soif you are lazy to learn SCSS syntax at first, youcan write CSS on a .SCSS file.)
  14. 14. Its Easy to use SCSS NOW3. Let Sass watch over your file:sass --watchsass --watchstylesheets/scss/app.scssstylesheets/scss/app.scss::stylesheets/css/app.cssstylesheets/css/app.cssWhich basically means Sass will convert all your.scss files inside the scss/ folder into valid CSSfiles inside the css/ folder automatically, withoutyou worrying over it.
  15. 15. More ResourcesThe official tutorial on Sass homepage:http://sass-lang.com/tutorial.htmlCompass: sort of a add-on to Sass that provideseven more features: http://compass-style.org/help/, but which I havent found absolutely necessaryto get into so far.
  16. 16. Questions?

×