SlideShare una empresa de Scribd logo
1 de 35
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Similar a 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
 

Similar a 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
 

Más 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
 

Más 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
 

Último

How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsArubSultan
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineCeline George
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
The role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipThe role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipKarl Donert
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
An Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPAn Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPCeline George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...Nguyen Thanh Tu Collection
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...
Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...
Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...Osopher
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Celine George
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 

Último (20)

Spearman's correlation,Formula,Advantages,
Spearman's correlation,Formula,Advantages,Spearman's correlation,Formula,Advantages,
Spearman's correlation,Formula,Advantages,
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristics
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command Line
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
The role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipThe role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenship
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
An Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERPAn Overview of the Calendar App in Odoo 17 ERP
An Overview of the Calendar App in Odoo 17 ERP
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - I-LEARN SMART WORLD - CẢ NĂM - CÓ FILE NGHE (BẢN...
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...
Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...
Healthy Minds, Flourishing Lives: A Philosophical Approach to Mental Health a...
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 

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