SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
Sass 101 Cleaning up your CSS Closet (once & for all)! 
Eric Sembrat - DrupalCamp Chattanooga - September 2014
Who Am I? 
A quick introduction!
Eric Sembrat 
• Web Manager for the College of 
Engineering at Georgia Tech 
• Ph.D. Student in Instructional 
Technology at Georgia State 
University 
! 
• Website: http://ericsembrat.com 
• Twitter: @esembrat 
• Hashtag: #Sassnooga
Our Roadmap 
• State of CSS 
• What is Sass? 
• How to Use Sass 
• Demo 
• Questions / Comments
The State of CSS 
Time to get serious about how we theme our themes
We’ve come a long way…
We’ve come a long way…
CSS Growing Up 
• Before CSS, there were 
inline element styles. 
! 
• Then CSS was born 
with style. 
! 
• Finally, CSS grew too 
big to live with HTML. 
<font color=“green” size=“8” family=“Wingdings”> 
<font style=“color: green; font-size: 8pt; font-family: 
Wingdings”> 
@import url(fancy-pants-css.css);
CSS Has Not Aged Well.. 
Variables 
CSS3 
Inheritance 
Reusability 
Clutter 
Media Queries 
Theme Templates
Some of this will change.. 
• CSS4 looks to fix some of 
these issues (1) 
• Parent Selectors 
• Grids 
• However, there’s still one big elephant in the room.
Don’t Repeat Yourself (DRY) 
The programming mantra of “Don’t Repeat Yourself”
What is DRY? 
• Minimizing repeating the 
same declaration over 
and over again 
• Modifications only happen in 
one place 
! 
• Modeled around the 
construction of 
repetitive, reusable, 
and scalable elements
DRY in CSS 
• CSS is too lazy to learn 
to DRY 
• Variables like color, font 
• Media queries 
• Chunks of CSS 
• So, how do we fix this mess we are in?
Sass to the Rescue!
What is Sass? 
How Sass cleans out the CSS closet, once and for all!
Preprocessor 
• Sass is a preprocessor for CSS 
• Converts Sass short-code into clunky, ugly CSS 
• Serves as a translator 
CSS 
compiles 
to 
SASS
Sass 
• Sass uses a very CSS-like syntax (.SCSS) to extend 
new features into the syntax you already know 
! 
• An alternative is a tab-centric syntax (.SASS)
Compare 
#main { 
color: blue; 
font-size: 0.3em; 
• Our CSS-friendly .SCSS 
formatting option. 
http://thesassway.com/editorial/sass-vs-scss-which-syntax-is-better 
} 
#main! 
color: blue 
font-size: 0.3em 
• Or, the tab-centric .SASS 
formatting option.
.SCSS vs. .SASS 
• Changing syntax is an automated process: 
• http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax
Using Sass 
How Sass cleans out the CSS closet, once and for all!
0) Test Sass All Day 
• SassMeister 
• http://sassmeister.com/
1) Get a App 
• Easiest way to get started is to download a Sass 
application. 
• http://sass-lang.com/install 
• Multi-platform releases 
• Free and paid products available
Scout 
Scout - http://mhs.github.io/scout-app/
CodeKit 
CodeKit - https://incident57.com/codekit/
2) Learn the Syntax 
• Learn many of the essential 
features of Sass. 
• Variables 
• Nesting 
• Mixins 
• Plugins 
• Partials 
• (and more!)
Variables 
$pretty-blue: #0000FF; 
$pretty-font-size: 0.3em; 
! 
#main { 
color: $pretty-blue; 
font-size: $pretty-font-size; 
} 
#main { 
color: #0000FF; 
font-size: 0.3em; 
}
Nesting 
$pretty-blue: #0000FF; 
! 
#main { 
color: $pretty-blue; 
font-size: 0.3em; 
#slideshow { 
background-color: 
mix(#FFF, $pretty-blue, 
20%); 
} 
} 
#main { 
color: #0000FF; 
font-size: 0.3em; 
} 
! 
#main #slideshow { 
background-color: #3333ff; 
}
Mixins 
@mixin chattanooga() { 
background-color: pink; 
font-size: 25pt; 
} 
! 
#body #chattanooga { 
@include chattanooga(); 
} 
#body #chattanooga { 
background-color: pink; 
font-size: 25pt; 
}
Mixins 
@mixin chattanooga() { 
background-color: pink; 
font-size: 25pt; 
Mixins can reference mixins! 
} 
! 
#body #chattanooga { 
@include chattanooga(); 
} 
#body #chattanooga { 
background-color: pink; 
font-size: 25pt; 
}
Mixins 
@mixin chattanooga() { 
background-color: pink; 
font-size: 25pt; 
Mixins can take arguments (with 
} 
! 
#body #chattanooga { 
default values)! 
@include chattanooga(); 
} 
#body #chattanooga { 
background-color: pink; 
font-size: 25pt; 
}
Plugins 
• Compass 
• http://compass-style.org/ 
• Sass Globbing 
• https://github.com/chriseppstein/sass-globbing 
• Breakpoint 
• http://breakpoint-sass.com/ 
• Bourbon 
• http://bourbon.io/
Partials 
compiles 
global.scss global.css 
to 
_hdr.scss 
_ftr.scss
Configure CSS Output 
• Sass uses a configuration file (config.rb) to control 
CSS output 
• Requires Compass 
• http://compass-style.org/help/documentation/configuration-reference/
Demo 
Quick highlights and features!
Let’s Chat 
Questions, Comments, Concerns, Discussions about Sass

Contenu connexe

Tendances

Journey To The Front End World - Part2 - The Cosmetic
Journey To The Front End World - Part2 - The  CosmeticJourney To The Front End World - Part2 - The  Cosmetic
Journey To The Front End World - Part2 - The CosmeticIrfan Maulana
 
October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101Eric Sembrat
 
Media Design for Libraries: Adding that Extra Pop
Media Design for Libraries: Adding that Extra PopMedia Design for Libraries: Adding that Extra Pop
Media Design for Libraries: Adding that Extra Poppsplib
 
Oooh shiny
Oooh shinyOooh shiny
Oooh shinywcto2017
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Campcanarymason
 
Functional Immutable CSS
Functional Immutable CSS Functional Immutable CSS
Functional Immutable CSS Pivorak MeetUp
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondDenise Jacobs
 
Mobile and Responsive Design with Sass
Mobile and Responsive Design with SassMobile and Responsive Design with Sass
Mobile and Responsive Design with Sassnyccamp
 
An Introduction to Sassy CSS
An Introduction to Sassy CSSAn Introduction to Sassy CSS
An Introduction to Sassy CSSStewart Curry
 
WordPress: A Designer's CMS
WordPress: A Designer's CMSWordPress: A Designer's CMS
WordPress: A Designer's CMSChelsea Otakan
 
Themer's roundtable
Themer's roundtableThemer's roundtable
Themer's roundtablecanarymason
 
Achieving Beautiful Typography in eBooks
Achieving Beautiful Typography in eBooksAchieving Beautiful Typography in eBooks
Achieving Beautiful Typography in eBooksdigitalbindery
 
Designing in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, DrupaldelphiaDesigning in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, Drupaldelphiacanarymason
 

Tendances (20)

Journey To The Front End World - Part2 - The Cosmetic
Journey To The Front End World - Part2 - The  CosmeticJourney To The Front End World - Part2 - The  Cosmetic
Journey To The Front End World - Part2 - The Cosmetic
 
October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101
 
Media Design for Libraries: Adding that Extra Pop
Media Design for Libraries: Adding that Extra PopMedia Design for Libraries: Adding that Extra Pop
Media Design for Libraries: Adding that Extra Pop
 
Oooh shiny
Oooh shinyOooh shiny
Oooh shiny
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Camp
 
Functional Immutable CSS
Functional Immutable CSS Functional Immutable CSS
Functional Immutable CSS
 
(Web ) Typography
(Web ) Typography(Web ) Typography
(Web ) Typography
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
Mobile and Responsive Design with Sass
Mobile and Responsive Design with SassMobile and Responsive Design with Sass
Mobile and Responsive Design with Sass
 
CSS
CSSCSS
CSS
 
An Introduction to Sassy CSS
An Introduction to Sassy CSSAn Introduction to Sassy CSS
An Introduction to Sassy CSS
 
WordPress: A Designer's CMS
WordPress: A Designer's CMSWordPress: A Designer's CMS
WordPress: A Designer's CMS
 
SASS Lecture
SASS Lecture SASS Lecture
SASS Lecture
 
Pemrograman Web 2 - CSS
Pemrograman Web 2 - CSSPemrograman Web 2 - CSS
Pemrograman Web 2 - CSS
 
Themer's roundtable
Themer's roundtableThemer's roundtable
Themer's roundtable
 
Mastering zen
Mastering zenMastering zen
Mastering zen
 
Css 3
Css 3Css 3
Css 3
 
Css 3
Css 3Css 3
Css 3
 
Achieving Beautiful Typography in eBooks
Achieving Beautiful Typography in eBooksAchieving Beautiful Typography in eBooks
Achieving Beautiful Typography in eBooks
 
Designing in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, DrupaldelphiaDesigning in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, Drupaldelphia
 

Similaire à Sass 101 Cleaning up your CSS Closet

Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compassNick Cooley
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Anam Hossain
 
Getting Sassy with CSS
Getting Sassy with CSSGetting Sassy with CSS
Getting Sassy with CSSJulie Cameron
 
What is-sass-by-lucas-castro
What is-sass-by-lucas-castroWhat is-sass-by-lucas-castro
What is-sass-by-lucas-castroLucas Castro
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersSuzette Franck
 
Turbo theming: Introduction to Sass & Compass
Turbo theming: Introduction to Sass & CompassTurbo theming: Introduction to Sass & Compass
Turbo theming: Introduction to Sass & CompassAlmog Baku
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassLucien Lee
 
Introduction to Bootstrap: Design for Developers
Introduction to Bootstrap: Design for DevelopersIntroduction to Bootstrap: Design for Developers
Introduction to Bootstrap: Design for DevelopersMelvin John
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentationJoeSeckelman
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Tahmina Khatoon
 
Responsive web design
Responsive web designResponsive web design
Responsive web designSean Wolfe
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondAndy Stratton
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. The University of Akron
 
CSS Workflow. Pre & Post
CSS Workflow. Pre & PostCSS Workflow. Pre & Post
CSS Workflow. Pre & PostAnton Dosov
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassClaudina Sarahe
 

Similaire à Sass 101 Cleaning up your CSS Closet (20)

Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01
 
Getting Sassy with CSS
Getting Sassy with CSSGetting Sassy with CSS
Getting Sassy with CSS
 
CSS3
CSS3CSS3
CSS3
 
What is-sass-by-lucas-castro
What is-sass-by-lucas-castroWhat is-sass-by-lucas-castro
What is-sass-by-lucas-castro
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
Turbo theming: Introduction to Sass & Compass
Turbo theming: Introduction to Sass & CompassTurbo theming: Introduction to Sass & Compass
Turbo theming: Introduction to Sass & Compass
 
Sass compass
Sass compassSass compass
Sass compass
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Introduction to Bootstrap: Design for Developers
Introduction to Bootstrap: Design for DevelopersIntroduction to Bootstrap: Design for Developers
Introduction to Bootstrap: Design for Developers
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 
Responsive web design
Responsive web designResponsive web design
Responsive web design
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
CSS Workflow. Pre & Post
CSS Workflow. Pre & PostCSS Workflow. Pre & Post
CSS Workflow. Pre & Post
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
 
Web
WebWeb
Web
 

Plus de Eric Sembrat

WPCampus 2019 - Website Renewal Services
WPCampus 2019 - Website Renewal ServicesWPCampus 2019 - Website Renewal Services
WPCampus 2019 - Website Renewal ServicesEric Sembrat
 
September 2018 - Georgia Tech - Science Communications Workshop - Building We...
September 2018 - Georgia Tech - Science Communications Workshop - Building We...September 2018 - Georgia Tech - Science Communications Workshop - Building We...
September 2018 - Georgia Tech - Science Communications Workshop - Building We...Eric Sembrat
 
USG Web Tech Day 2018 - Microsoft Teams, Collaboration, & You
USG Web Tech Day 2018 - Microsoft Teams, Collaboration, & YouUSG Web Tech Day 2018 - Microsoft Teams, Collaboration, & You
USG Web Tech Day 2018 - Microsoft Teams, Collaboration, & YouEric Sembrat
 
USG Web Tech Day 2017 - CMS Tunnel Vision
USG Web Tech Day 2017 - CMS Tunnel VisionUSG Web Tech Day 2017 - CMS Tunnel Vision
USG Web Tech Day 2017 - CMS Tunnel VisionEric Sembrat
 
USG Rock Eagle 2017 - PWP at 1000 Days
USG Rock Eagle 2017 - PWP at 1000 DaysUSG Rock Eagle 2017 - PWP at 1000 Days
USG Rock Eagle 2017 - PWP at 1000 DaysEric Sembrat
 
HighEdWeb 2017 - Unbundle Your Institution: Building a Web Ecosystem
HighEdWeb 2017 - Unbundle Your Institution: Building a Web EcosystemHighEdWeb 2017 - Unbundle Your Institution: Building a Web Ecosystem
HighEdWeb 2017 - Unbundle Your Institution: Building a Web EcosystemEric Sembrat
 
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...Eric Sembrat
 
November 2016 - ECN - You're Speaking Drupalese to Me
November 2016 - ECN - You're Speaking Drupalese to MeNovember 2016 - ECN - You're Speaking Drupalese to Me
November 2016 - ECN - You're Speaking Drupalese to MeEric Sembrat
 
November 2016 - Georgia Tech - Building a Research Website
November 2016 - Georgia Tech - Building a Research WebsiteNovember 2016 - Georgia Tech - Building a Research Website
November 2016 - Georgia Tech - Building a Research WebsiteEric Sembrat
 
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...Eric Sembrat
 
October 2016 - edUi - Save Us, Self Service!
October 2016 - edUi - Save Us, Self Service!October 2016 - edUi - Save Us, Self Service!
October 2016 - edUi - Save Us, Self Service!Eric Sembrat
 
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS Organization
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS OrganizationApril 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS Organization
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS OrganizationEric Sembrat
 
August 2016 - DrupalCorn - The Paragraphs Cake - Structured & Layered Content...
August 2016 - DrupalCorn - The Paragraphs Cake - Structured & Layered Content...August 2016 - DrupalCorn - The Paragraphs Cake - Structured & Layered Content...
August 2016 - DrupalCorn - The Paragraphs Cake - Structured & Layered Content...Eric Sembrat
 
April 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child ThemesApril 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child ThemesEric Sembrat
 
April 2016 - USG Web Tech Day - Let's Talk Drupal
April 2016 - USG Web Tech Day - Let's Talk DrupalApril 2016 - USG Web Tech Day - Let's Talk Drupal
April 2016 - USG Web Tech Day - Let's Talk DrupalEric Sembrat
 
October 2015 - USG Rock Eagle - USGweb
October 2015 - USG Rock Eagle - USGwebOctober 2015 - USG Rock Eagle - USGweb
October 2015 - USG Rock Eagle - USGwebEric Sembrat
 
October 2015 - USG Rock Eagle - Drupal 8
October 2015 - USG Rock Eagle - Drupal 8October 2015 - USG Rock Eagle - Drupal 8
October 2015 - USG Rock Eagle - Drupal 8Eric Sembrat
 
USG Rock Eagle - October 2015 - PWP at Georgia Tech
USG Rock Eagle - October 2015 - PWP at Georgia TechUSG Rock Eagle - October 2015 - PWP at Georgia Tech
USG Rock Eagle - October 2015 - PWP at Georgia TechEric Sembrat
 
Atlanta Drupal Users Group - October 2015 - Success of the GT Redesign
Atlanta Drupal Users Group - October 2015 - Success of the GT RedesignAtlanta Drupal Users Group - October 2015 - Success of the GT Redesign
Atlanta Drupal Users Group - October 2015 - Success of the GT RedesignEric Sembrat
 
August 2015 - Web Governance - PWP Introduction
August 2015 - Web Governance - PWP IntroductionAugust 2015 - Web Governance - PWP Introduction
August 2015 - Web Governance - PWP IntroductionEric Sembrat
 

Plus de Eric Sembrat (20)

WPCampus 2019 - Website Renewal Services
WPCampus 2019 - Website Renewal ServicesWPCampus 2019 - Website Renewal Services
WPCampus 2019 - Website Renewal Services
 
September 2018 - Georgia Tech - Science Communications Workshop - Building We...
September 2018 - Georgia Tech - Science Communications Workshop - Building We...September 2018 - Georgia Tech - Science Communications Workshop - Building We...
September 2018 - Georgia Tech - Science Communications Workshop - Building We...
 
USG Web Tech Day 2018 - Microsoft Teams, Collaboration, & You
USG Web Tech Day 2018 - Microsoft Teams, Collaboration, & YouUSG Web Tech Day 2018 - Microsoft Teams, Collaboration, & You
USG Web Tech Day 2018 - Microsoft Teams, Collaboration, & You
 
USG Web Tech Day 2017 - CMS Tunnel Vision
USG Web Tech Day 2017 - CMS Tunnel VisionUSG Web Tech Day 2017 - CMS Tunnel Vision
USG Web Tech Day 2017 - CMS Tunnel Vision
 
USG Rock Eagle 2017 - PWP at 1000 Days
USG Rock Eagle 2017 - PWP at 1000 DaysUSG Rock Eagle 2017 - PWP at 1000 Days
USG Rock Eagle 2017 - PWP at 1000 Days
 
HighEdWeb 2017 - Unbundle Your Institution: Building a Web Ecosystem
HighEdWeb 2017 - Unbundle Your Institution: Building a Web EcosystemHighEdWeb 2017 - Unbundle Your Institution: Building a Web Ecosystem
HighEdWeb 2017 - Unbundle Your Institution: Building a Web Ecosystem
 
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
 
November 2016 - ECN - You're Speaking Drupalese to Me
November 2016 - ECN - You're Speaking Drupalese to MeNovember 2016 - ECN - You're Speaking Drupalese to Me
November 2016 - ECN - You're Speaking Drupalese to Me
 
November 2016 - Georgia Tech - Building a Research Website
November 2016 - Georgia Tech - Building a Research WebsiteNovember 2016 - Georgia Tech - Building a Research Website
November 2016 - Georgia Tech - Building a Research Website
 
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
 
October 2016 - edUi - Save Us, Self Service!
October 2016 - edUi - Save Us, Self Service!October 2016 - edUi - Save Us, Self Service!
October 2016 - edUi - Save Us, Self Service!
 
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS Organization
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS OrganizationApril 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS Organization
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS Organization
 
August 2016 - DrupalCorn - The Paragraphs Cake - Structured & Layered Content...
August 2016 - DrupalCorn - The Paragraphs Cake - Structured & Layered Content...August 2016 - DrupalCorn - The Paragraphs Cake - Structured & Layered Content...
August 2016 - DrupalCorn - The Paragraphs Cake - Structured & Layered Content...
 
April 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child ThemesApril 2016 - Atlanta WordPress Users Group - Child Themes
April 2016 - Atlanta WordPress Users Group - Child Themes
 
April 2016 - USG Web Tech Day - Let's Talk Drupal
April 2016 - USG Web Tech Day - Let's Talk DrupalApril 2016 - USG Web Tech Day - Let's Talk Drupal
April 2016 - USG Web Tech Day - Let's Talk Drupal
 
October 2015 - USG Rock Eagle - USGweb
October 2015 - USG Rock Eagle - USGwebOctober 2015 - USG Rock Eagle - USGweb
October 2015 - USG Rock Eagle - USGweb
 
October 2015 - USG Rock Eagle - Drupal 8
October 2015 - USG Rock Eagle - Drupal 8October 2015 - USG Rock Eagle - Drupal 8
October 2015 - USG Rock Eagle - Drupal 8
 
USG Rock Eagle - October 2015 - PWP at Georgia Tech
USG Rock Eagle - October 2015 - PWP at Georgia TechUSG Rock Eagle - October 2015 - PWP at Georgia Tech
USG Rock Eagle - October 2015 - PWP at Georgia Tech
 
Atlanta Drupal Users Group - October 2015 - Success of the GT Redesign
Atlanta Drupal Users Group - October 2015 - Success of the GT RedesignAtlanta Drupal Users Group - October 2015 - Success of the GT Redesign
Atlanta Drupal Users Group - October 2015 - Success of the GT Redesign
 
August 2015 - Web Governance - PWP Introduction
August 2015 - Web Governance - PWP IntroductionAugust 2015 - Web Governance - PWP Introduction
August 2015 - Web Governance - PWP Introduction
 

Dernier

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 

Dernier (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 

Sass 101 Cleaning up your CSS Closet

  • 1. Sass 101 Cleaning up your CSS Closet (once & for all)! Eric Sembrat - DrupalCamp Chattanooga - September 2014
  • 2. Who Am I? A quick introduction!
  • 3. Eric Sembrat • Web Manager for the College of Engineering at Georgia Tech • Ph.D. Student in Instructional Technology at Georgia State University ! • Website: http://ericsembrat.com • Twitter: @esembrat • Hashtag: #Sassnooga
  • 4. Our Roadmap • State of CSS • What is Sass? • How to Use Sass • Demo • Questions / Comments
  • 5. The State of CSS Time to get serious about how we theme our themes
  • 6. We’ve come a long way…
  • 7. We’ve come a long way…
  • 8. CSS Growing Up • Before CSS, there were inline element styles. ! • Then CSS was born with style. ! • Finally, CSS grew too big to live with HTML. <font color=“green” size=“8” family=“Wingdings”> <font style=“color: green; font-size: 8pt; font-family: Wingdings”> @import url(fancy-pants-css.css);
  • 9. CSS Has Not Aged Well.. Variables CSS3 Inheritance Reusability Clutter Media Queries Theme Templates
  • 10. Some of this will change.. • CSS4 looks to fix some of these issues (1) • Parent Selectors • Grids • However, there’s still one big elephant in the room.
  • 11. Don’t Repeat Yourself (DRY) The programming mantra of “Don’t Repeat Yourself”
  • 12. What is DRY? • Minimizing repeating the same declaration over and over again • Modifications only happen in one place ! • Modeled around the construction of repetitive, reusable, and scalable elements
  • 13. DRY in CSS • CSS is too lazy to learn to DRY • Variables like color, font • Media queries • Chunks of CSS • So, how do we fix this mess we are in?
  • 14. Sass to the Rescue!
  • 15. What is Sass? How Sass cleans out the CSS closet, once and for all!
  • 16. Preprocessor • Sass is a preprocessor for CSS • Converts Sass short-code into clunky, ugly CSS • Serves as a translator CSS compiles to SASS
  • 17. Sass • Sass uses a very CSS-like syntax (.SCSS) to extend new features into the syntax you already know ! • An alternative is a tab-centric syntax (.SASS)
  • 18. Compare #main { color: blue; font-size: 0.3em; • Our CSS-friendly .SCSS formatting option. http://thesassway.com/editorial/sass-vs-scss-which-syntax-is-better } #main! color: blue font-size: 0.3em • Or, the tab-centric .SASS formatting option.
  • 19. .SCSS vs. .SASS • Changing syntax is an automated process: • http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax
  • 20. Using Sass How Sass cleans out the CSS closet, once and for all!
  • 21. 0) Test Sass All Day • SassMeister • http://sassmeister.com/
  • 22. 1) Get a App • Easiest way to get started is to download a Sass application. • http://sass-lang.com/install • Multi-platform releases • Free and paid products available
  • 23. Scout Scout - http://mhs.github.io/scout-app/
  • 24. CodeKit CodeKit - https://incident57.com/codekit/
  • 25. 2) Learn the Syntax • Learn many of the essential features of Sass. • Variables • Nesting • Mixins • Plugins • Partials • (and more!)
  • 26. Variables $pretty-blue: #0000FF; $pretty-font-size: 0.3em; ! #main { color: $pretty-blue; font-size: $pretty-font-size; } #main { color: #0000FF; font-size: 0.3em; }
  • 27. Nesting $pretty-blue: #0000FF; ! #main { color: $pretty-blue; font-size: 0.3em; #slideshow { background-color: mix(#FFF, $pretty-blue, 20%); } } #main { color: #0000FF; font-size: 0.3em; } ! #main #slideshow { background-color: #3333ff; }
  • 28. Mixins @mixin chattanooga() { background-color: pink; font-size: 25pt; } ! #body #chattanooga { @include chattanooga(); } #body #chattanooga { background-color: pink; font-size: 25pt; }
  • 29. Mixins @mixin chattanooga() { background-color: pink; font-size: 25pt; Mixins can reference mixins! } ! #body #chattanooga { @include chattanooga(); } #body #chattanooga { background-color: pink; font-size: 25pt; }
  • 30. Mixins @mixin chattanooga() { background-color: pink; font-size: 25pt; Mixins can take arguments (with } ! #body #chattanooga { default values)! @include chattanooga(); } #body #chattanooga { background-color: pink; font-size: 25pt; }
  • 31. Plugins • Compass • http://compass-style.org/ • Sass Globbing • https://github.com/chriseppstein/sass-globbing • Breakpoint • http://breakpoint-sass.com/ • Bourbon • http://bourbon.io/
  • 32. Partials compiles global.scss global.css to _hdr.scss _ftr.scss
  • 33. Configure CSS Output • Sass uses a configuration file (config.rb) to control CSS output • Requires Compass • http://compass-style.org/help/documentation/configuration-reference/
  • 34. Demo Quick highlights and features!
  • 35. Let’s Chat Questions, Comments, Concerns, Discussions about Sass