SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
Sassive Aggressive
// Level Up Your CSS with Sass
@import the-awesome
What is Sass?
What is Sass?
       Syntactically
       awesome
       stylesheets
We all use CSS sucks
but
We all use CSS sucks
but
We all use CSS sucks
  Especially if you’ve used Sass.
Sass takes everything
that’s missing from CSS
  and puts it into CSS.
Sass takes everything
that’s missing from CSS
  and puts it into CSS.
Things like…
h1 {
  color: #000;
  font: 16px/1.6 Georgia;
  margin: 0;
}
Variables
h1 {
  color: $logo-color;
  font: 16px/1.6 Georgia;
  margin: 0;
}
Nesting
h1 {
  color: #000;
  font: 16px/1.6 Georgia;
  margin: 0;
  a {
    display: block;
    width: 100px;
    height: 50px;
  }
}
The Ampersand
h1 {
  color: #000;
  font: 16px/1.6 Georgia;
  margin: 0;
  &.new {
    color: red;
  }
}
Selector Inheritance
h1 {
  color: #000;
  font: 16px/1.6 Georgia;
  margin: 0;
}
h2 {
  @extend h1;
  font-size: 14px;
}
Calculations
h1 {
  color: #000;
  font: 16px/1.6 Georgia;
  margin: $default_margin * 2;
}
Color Manipulation
h1 {
  color: lighten(#000, 25%);
  font: 16px/1.6 Georgia;
  margin: 0;
}
Mixins
h1 {
  color: #000;
  font: 16px/1.6 Georgia;
  margin: 0;
  @include border-radius(4px);
}
And so, so much more.
Sass does not replace CSS.
Sass does not replace CSS.
    Sass makes CSS.
Sass does not replace CSS.
    Sass makes CSS.
          better.
Three more things
 before we play…
1   What’s                                           ?
                http://compass-style.org



    • a framework that uses Sass
    • an open source project
    • a collection of reusable design patterns that
      makes using the latest CSS features super easy

    Compass is not Sass, but they are oen grouped
    together.
2   Two Syntaxes
        SCSS
2   Two Syntaxes
             SCSS
    h1 {
      color: #000;
      font: 16px/1.6 Georgia;
      margin: 0;
      a {
         display: block;
         width: 100px;
         height: 50px;
      }
    }
2   Two Syntaxes
             SCSS    booooooo

    h1 {
      color: #000;
      font: 16px/1.6 Georgia;
      margin: 0;
      a {
         display: block;
         width: 100px;
         height: 50px;
      }
    }
2   Two Syntaxes
                SCSS       booooooo

      h1 {                         of the
        color: #000; ’s op   inion
            ER: A  dam
                             esent Joel’s
   S CLAIM 16px/1.6 pr
        font:        ot re Georgia; .
DI          ta x do n          yntax
 SCS  S margin:f the SCSS s
        syn       0;
      opin{
        a  ion o
           display: block;
           width: 100px;
           height: 50px;
        }
      }
2   Two Syntaxes
             Sass
    h1
      color: #000
      font: 16px/1.6 Georgia
      margin: 0
      a
        display: block
        width: 100px
        height: 50px
2   Two Syntaxes
             Sass    yaaaaaay

    h1
      color: #000
      font: 16px/1.6 Georgia
      margin: 0
      a
        display: block
        width: 100px
        height: 50px
3   The Command Line


        Don’t be afraid.
Let’s look at some code!
itche d to a
                  point  , we sw th Sass/
    TE: A  t this      tratio n (wi
NO            demo  ns          to-up dating
 liv e code e left and au
          on th             n the r ight).
  SCSS         iled C SS o
        comp
See the code:
       https://github.com/jayroh/sass-harvard

    Note that the code samples are stored within the same file, but on
      different branches. Here are the direct links to each branch:


Ampersand (Sass/SCSS)                  Mixins (Sass/SCSS)
Calculations (Sass/SCSS)               Nesting (Sass/SCSS)
     Colors (Sass/SCSS)                Partials (Sass/SCSS)
   Compass (Sass/SCSS)                 Responsive (Sass/SCSS)
     Extend (Sass/SCSS)                Sprites (Sass/SCSS)
      Loops (Sass/SCSS)                Variables (Sass/SCSS)
Who are these guys?
Joel Oliveira   Adam Darowski
    e47th         PatientsLikeMe




   @jayroh         @adarowski

Contenu connexe

Similaire à Sassive Aggressive: Level Up Your CSS with Sass

Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with SassSven Wolfermann
 
Peggy sass vs scss
Peggy  sass vs scssPeggy  sass vs scss
Peggy sass vs scssLearningTech
 
The Future of CSS
The Future of CSSThe Future of CSS
The Future of CSSBret Little
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob Davarnia
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Startededgincvg
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sassHuiyi Yan
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)emrox
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Anam Hossain
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and howmirahman
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentationMario Noble
 
DrupalCamp Chattanooga - September 2014 - Sass 101
DrupalCamp Chattanooga - September 2014 - Sass 101DrupalCamp Chattanooga - September 2014 - Sass 101
DrupalCamp Chattanooga - September 2014 - Sass 101Eric Sembrat
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compassNick Cooley
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)Folio3 Software
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsKaelig Deloumeau-Prigent
 

Similaire à Sassive Aggressive: Level Up Your CSS with Sass (20)

Intro to SASS CSS
Intro to SASS CSSIntro to SASS CSS
Intro to SASS CSS
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
 
Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with Sass
 
Peggy sass vs scss
Peggy  sass vs scssPeggy  sass vs scss
Peggy sass vs scss
 
The Future of CSS
The Future of CSSThe Future of CSS
The Future of CSS
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Started
 
Sass
SassSass
Sass
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sass
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and how
 
Advanced sass
Advanced sassAdvanced sass
Advanced sass
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
DrupalCamp Chattanooga - September 2014 - Sass 101
DrupalCamp Chattanooga - September 2014 - Sass 101DrupalCamp Chattanooga - September 2014 - Sass 101
DrupalCamp Chattanooga - September 2014 - Sass 101
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
 

Dernier

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Dernier (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Sassive Aggressive: Level Up Your CSS with Sass

  • 1. Sassive Aggressive // Level Up Your CSS with Sass @import the-awesome
  • 3. What is Sass? Syntactically awesome stylesheets
  • 4. We all use CSS sucks
  • 5. but We all use CSS sucks
  • 6. but We all use CSS sucks Especially if you’ve used Sass.
  • 7. Sass takes everything that’s missing from CSS and puts it into CSS.
  • 8. Sass takes everything that’s missing from CSS and puts it into CSS.
  • 9. Things like… h1 { color: #000; font: 16px/1.6 Georgia; margin: 0; }
  • 10. Variables h1 { color: $logo-color; font: 16px/1.6 Georgia; margin: 0; }
  • 11. Nesting h1 { color: #000; font: 16px/1.6 Georgia; margin: 0; a { display: block; width: 100px; height: 50px; } }
  • 12. The Ampersand h1 { color: #000; font: 16px/1.6 Georgia; margin: 0; &.new { color: red; } }
  • 13. Selector Inheritance h1 { color: #000; font: 16px/1.6 Georgia; margin: 0; } h2 { @extend h1; font-size: 14px; }
  • 14. Calculations h1 { color: #000; font: 16px/1.6 Georgia; margin: $default_margin * 2; }
  • 15. Color Manipulation h1 { color: lighten(#000, 25%); font: 16px/1.6 Georgia; margin: 0; }
  • 16. Mixins h1 { color: #000; font: 16px/1.6 Georgia; margin: 0; @include border-radius(4px); }
  • 17. And so, so much more.
  • 18. Sass does not replace CSS.
  • 19. Sass does not replace CSS. Sass makes CSS.
  • 20. Sass does not replace CSS. Sass makes CSS. better.
  • 21. Three more things before we play…
  • 22. 1 What’s ? http://compass-style.org • a framework that uses Sass • an open source project • a collection of reusable design patterns that makes using the latest CSS features super easy Compass is not Sass, but they are oen grouped together.
  • 23. 2 Two Syntaxes SCSS
  • 24. 2 Two Syntaxes SCSS h1 { color: #000; font: 16px/1.6 Georgia; margin: 0; a { display: block; width: 100px; height: 50px; } }
  • 25. 2 Two Syntaxes SCSS booooooo h1 { color: #000; font: 16px/1.6 Georgia; margin: 0; a { display: block; width: 100px; height: 50px; } }
  • 26. 2 Two Syntaxes SCSS booooooo h1 { of the color: #000; ’s op inion ER: A dam esent Joel’s S CLAIM 16px/1.6 pr font: ot re Georgia; . DI ta x do n yntax SCS S margin:f the SCSS s syn 0; opin{ a ion o display: block; width: 100px; height: 50px; } }
  • 27. 2 Two Syntaxes Sass h1 color: #000 font: 16px/1.6 Georgia margin: 0 a display: block width: 100px height: 50px
  • 28. 2 Two Syntaxes Sass yaaaaaay h1 color: #000 font: 16px/1.6 Georgia margin: 0 a display: block width: 100px height: 50px
  • 29. 3 The Command Line Don’t be afraid.
  • 30. Let’s look at some code!
  • 31. itche d to a point , we sw th Sass/ TE: A t this tratio n (wi NO demo ns to-up dating liv e code e left and au on th n the r ight). SCSS iled C SS o comp
  • 32. See the code: https://github.com/jayroh/sass-harvard Note that the code samples are stored within the same file, but on different branches. Here are the direct links to each branch: Ampersand (Sass/SCSS) Mixins (Sass/SCSS) Calculations (Sass/SCSS) Nesting (Sass/SCSS) Colors (Sass/SCSS) Partials (Sass/SCSS) Compass (Sass/SCSS) Responsive (Sass/SCSS) Extend (Sass/SCSS) Sprites (Sass/SCSS) Loops (Sass/SCSS) Variables (Sass/SCSS)
  • 33. Who are these guys? Joel Oliveira Adam Darowski e47th PatientsLikeMe @jayroh @adarowski