SlideShare una empresa de Scribd logo
1 de 16
SCSS: The Basics
First Things First

SASS=SCSS. Sass is the name of the framework,
while SCSS is basically the file extension name
used for Sass. E.g. style.scss. They are often used
interchangeably.

SCSS files are just CSS files with a .scss
extension, i.e. you can still write your old css in
an .scss file.
Why Use SCSS?
1. Better Organization/Modularization of CSS files:
It is possible to break down CSS into different files
without using SCSS, but then:
1. It will be a pain to manually concatenate them into
one or two files
2. If we do not concatenate them, and instead rely on
the @import directive, then we will be making
many HTTP requests to load the respective CSS,
thus increasing load time.
I.e. SCSS Concatenates Modularized
Files Automatically and Converts
Them into Valid CSS Files
Why Use SCSS?
2. Able to use Variables with CSS
E.g. instead of copy-pasting the color #F89939 everywhere
we need it, we do:
/* Define our custom orange color */
$yellow: #ffd320;
/* Use it anywhere */
.box {border:1px solid $yellow;}
div{background-color:$yellow;}
Using variables also means: no more Find and
Replace String if we decide to change property
values:
/*Just change here:*/
$yellow: #ffce54;
/* And it's reflected everywhere */
.box {border:1px solid $yellow;}
div{background-color:$yellow;}
I.e. SCSS Allows Use of Variables
that Cuts Down Development Time
Why Use SCSS?
3. Automatic minification of CSS files
4. Able to use standard math operations (+, -, *, /,
and %) with CSS
5. Adjust colors within SCSS, e.g. darken($yellow,
20%);
6. Use arguments and functions, …
And More.
Everyone Has to Come Onboard
E.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;}
Everyone Has to Come Onboard
Bhagaban doesn't use SCSS. Instead, he customizes
directly on style.css:
.button{
font-size:10px;
background-color:#ffce54;
}
Everyone Has to Come Onboard
Anthony isn't aware of that particular change, and
continues 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 Bhagaban's font-size:10px;
without knowing it.
It's Easy to Use SCSS NOW
1. With Ruby already installed on Mac, all we need
is:
gem install sassgem install sass
2. Instead of editing a CSS file, we now edit a .SCSS
file. Either I pass you the SCSS file I started off,
or you can simply save your CSS file with .SCSS
extension. (Every valid CSS rule is valid SCSS, so
if you are lazy to learn SCSS syntax at first, you
can write CSS on a .SCSS file.)
It's Easy to use SCSS NOW
3. Let Sass watch over your file:
sass --watchsass --watch
stylesheets/scss/app.scssstylesheets/scss/app.scss
::
stylesheets/css/app.cssstylesheets/css/app.css
Which basically means Sass will convert all your
.scss files inside the scss/ folder into valid CSS
files inside the css/ folder automatically, without
you worrying over it.
More Resources

The official tutorial on Sass homepage:
http://sass-lang.com/tutorial.html

Compass: sort of a add-on to Sass that provides
even more features: http://compass-style.org/help/
, but which I haven't found absolutely necessary
to get into so far.
Questions?

Más contenido relacionado

Destacado

CSS Best Practices
CSS Best PracticesCSS Best Practices
CSS Best Practicesnolly00
 
Getting Started With Sass | WC Philly 2015
Getting Started With Sass | WC Philly 2015Getting Started With Sass | WC Philly 2015
Getting Started With Sass | WC Philly 2015Maura Teal
 
Getting SASSy with front end development
Getting SASSy with front end developmentGetting SASSy with front end development
Getting SASSy with front end developmentMatthew Carleton
 
SASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetSASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetNeha Sharma
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASSJon Dean
 
CSS3 secrets: 10 things you might not know about CSS3
CSS3 secrets: 10 things you might not know about CSS3CSS3 secrets: 10 things you might not know about CSS3
CSS3 secrets: 10 things you might not know about CSS3Lea Verou
 
Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Eric Sembrat
 

Destacado (10)

CSS Best Practices
CSS Best PracticesCSS Best Practices
CSS Best Practices
 
Getting Started With Sass | WC Philly 2015
Getting Started With Sass | WC Philly 2015Getting Started With Sass | WC Philly 2015
Getting Started With Sass | WC Philly 2015
 
Intro to SASS CSS
Intro to SASS CSSIntro to SASS CSS
Intro to SASS CSS
 
Getting SASSy with front end development
Getting SASSy with front end developmentGetting SASSy with front end development
Getting SASSy with front end development
 
Sass: Introduction
Sass: IntroductionSass: Introduction
Sass: Introduction
 
SASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetSASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome Stylesheet
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASS
 
CSS3 secrets: 10 things you might not know about CSS3
CSS3 secrets: 10 things you might not know about CSS3CSS3 secrets: 10 things you might not know about CSS3
CSS3 secrets: 10 things you might not know about CSS3
 
Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Sass - Getting Started with Sass!
Sass - Getting Started with Sass!
 
Fundamental CSS3
Fundamental CSS3Fundamental CSS3
Fundamental CSS3
 

Similar a Using scss-at-noisestreet

Syntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech SoftwareSyntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech SoftwareRitwik Das
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS ImplementationAmey Parab
 
Beautifying Sencha Touch
Beautifying Sencha TouchBeautifying Sencha Touch
Beautifying Sencha TouchNeha Upadhyay
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersSuzette Franck
 
The sass way - Yatendra Bhardwaj
The sass way - Yatendra BhardwajThe sass way - Yatendra Bhardwaj
The sass way - Yatendra BhardwajYatendra Bhardwaj
 
Sass that CSS
Sass that CSSSass that CSS
Sass that CSSTrish Ang
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob Davarnia
 
Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with SassSven Wolfermann
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESSItai Koren
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSSteve Krueger
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quickBilly Shih
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentationJoeSeckelman
 
Introduction to CSS Preprocessors
Introduction to CSS PreprocessorsIntroduction to CSS Preprocessors
Introduction to CSS PreprocessorsBlake Newman
 
Introducing grunt, npm and sass
Introducing grunt, npm and sassIntroducing grunt, npm and sass
Introducing grunt, npm and sasspriyanka1452
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}Eric Carlisle
 

Similar a Using scss-at-noisestreet (20)

Syntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech SoftwareSyntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech Software
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
Beautifying Sencha Touch
Beautifying Sencha TouchBeautifying Sencha Touch
Beautifying Sencha Touch
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Beautifying senc
Beautifying sencBeautifying senc
Beautifying senc
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
The sass way - Yatendra Bhardwaj
The sass way - Yatendra BhardwajThe sass way - Yatendra Bhardwaj
The sass way - Yatendra Bhardwaj
 
Sass that CSS
Sass that CSSSass that CSS
Sass that CSS
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with Sass
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASS
 
css-tools
css-toolscss-tools
css-tools
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quick
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
 
Advanced sass
Advanced sassAdvanced sass
Advanced sass
 
Introduction to CSS Preprocessors
Introduction to CSS PreprocessorsIntroduction to CSS Preprocessors
Introduction to CSS Preprocessors
 
Introducing grunt, npm and sass
Introducing grunt, npm and sassIntroducing grunt, npm and sass
Introducing grunt, npm and sass
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
 

Último

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Último (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Using scss-at-noisestreet

  • 2. First Things First  SASS=SCSS. Sass is the name of the framework, while SCSS is basically the file extension name used for Sass. E.g. style.scss. They are often used interchangeably.  SCSS files are just CSS files with a .scss extension, i.e. you can still write your old css in an .scss file.
  • 3. Why Use SCSS? 1. Better Organization/Modularization of CSS files:
  • 4. It is possible to break down CSS into different files without using SCSS, but then: 1. It will be a pain to manually concatenate them into one or two files 2. If we do not concatenate them, and instead rely on the @import directive, then we will be making many HTTP requests to load the respective CSS, thus increasing load time.
  • 5. I.e. SCSS Concatenates Modularized Files Automatically and Converts Them into Valid CSS Files
  • 6. Why Use SCSS? 2. Able to use Variables with CSS E.g. instead of copy-pasting the color #F89939 everywhere we need it, we do: /* Define our custom orange color */ $yellow: #ffd320; /* Use it anywhere */ .box {border:1px solid $yellow;} div{background-color:$yellow;}
  • 7. Using variables also means: no more Find and Replace String if we decide to change property values: /*Just change here:*/ $yellow: #ffce54; /* And it's reflected everywhere */ .box {border:1px solid $yellow;} div{background-color:$yellow;}
  • 8. I.e. SCSS Allows Use of Variables that Cuts Down Development Time
  • 9. Why Use SCSS? 3. Automatic minification of CSS files 4. Able to use standard math operations (+, -, *, /, and %) with CSS 5. Adjust colors within SCSS, e.g. darken($yellow, 20%); 6. Use arguments and functions, … And More.
  • 10. Everyone Has to Come Onboard E.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. Everyone Has to Come Onboard Bhagaban doesn't use SCSS. Instead, he customizes directly on style.css: .button{ font-size:10px; background-color:#ffce54; }
  • 12. Everyone Has to Come Onboard Anthony isn't aware of that particular change, and continues 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 Bhagaban's font-size:10px; without knowing it.
  • 13. It's Easy to Use SCSS NOW 1. With Ruby already installed on Mac, all we need is: gem install sassgem install sass 2. Instead of editing a CSS file, we now edit a .SCSS file. Either I pass you the SCSS file I started off, or you can simply save your CSS file with .SCSS extension. (Every valid CSS rule is valid SCSS, so if you are lazy to learn SCSS syntax at first, you can write CSS on a .SCSS file.)
  • 14. It's Easy to use SCSS NOW 3. Let Sass watch over your file: sass --watchsass --watch stylesheets/scss/app.scssstylesheets/scss/app.scss :: stylesheets/css/app.cssstylesheets/css/app.css Which basically means Sass will convert all your .scss files inside the scss/ folder into valid CSS files inside the css/ folder automatically, without you worrying over it.
  • 15. More Resources  The official tutorial on Sass homepage: http://sass-lang.com/tutorial.html  Compass: sort of a add-on to Sass that provides even more features: http://compass-style.org/help/ , but which I haven't found absolutely necessary to get into so far.