SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
./Oi! eu sou Lourdes
Presentation Code Developer
@ R/GA Buenos Aires
@loumontano
./Agenda
./ What is Sass
./ Setup
./ File structure
./ Features
./ Useful Mixins
./ Good practices
./A Quick note about Sass
File structure
Partials - Sub-files compiled in one single CSS file
@import - Defines the output order on the compiled CSS
./Features
Sass Features
- Variables
- Nesting
- Mixins
- Extends / Placeholders
- Math Operators
- Functions
- Control directives
- Maps
- and more!
Variables
- Same as other languages (placeholder name, scope, etc.)
- Can use: color values, texts, booleans, numbers, etc.
Nesting
- Easy to read. Faster to write
- Follow the 3 or 4 nesting levels rule (check generated CSS)
./Reusability
@mixin
- CSS rules that you can reuse
- Use with dynamic values
- Very useful for vendor prefixes
- Used for reuse rules, not values
@extend
- For properties sharing without parameters
- Con: it’s also generated on the CSS output
@extend + %placeholder
- Placeholders don’t get compiled on the CSS output
- Can be used via @extend
./Functions
Math operators
Native Sass Functions
- Support math operators
- HSL color functions available (Hue, Saturation, Lightness & Opacity)
Custom functions
- Allow calculations
- Unlike @mixin, there is a @return for a value
./Control directives
Control directives @if
Control directives @for
http://codepen.io/loumontano/pen/WbzBgz?editors=010
Control directives @each
./Useful Mixins
Clearfix
Vertical align
Media Queries - Breakpoints
Grids
Animations
http://codepen.io/loumontano/pen/eJByH
Transitions
- Key/Value data sets
- Unique list of keys
- Access to the keys and values
- Ability to iterate through these values
./Good practices
Think of a preprocessor as
a magnifying glass: it can
make good CSS great, but
bad CSS terrible. It’s not a
magic bullet.
Harry Roberts
Manejo responsable de Sass
The Good Sass dev Checklist
- Good file structure
- Proper variable usage
- Use mixins for dynamic values, otherwise use extend
- Use functions for calculations
- Limit nesting: 3 or 4 levels max
- Like in CSS, avoid specificity
- Check CSS output
Final thoughts
- Good for CSS code organization
- Allows functions and variables handling
- Tons of documentation available
- Check CSS output
- Sass helps you to write CSS faster, not better. (that’s up to you!)
Links
http://sass-lang.com/
http://terrificwebdesign.net/converting-css-sass/
http://thesassway.com/advanced
http://sass-guidelin.es/
http://sass-compatibility.github.io/
http://sassmeister.com/
http://thesassway.com/
http://www.sitepoint.com/html-css/css/sass-css/
http://jaredhardy.com/sassy-buttons/
http://bourbon.io/
./Valeu!
@loumontano

Weitere ähnliche Inhalte

Ähnlich wie Sass conferencia css-sp

Rh10 css presentation
Rh10 css presentationRh10 css presentation
Rh10 css presentationNeil Perlin
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sasschriseppstein
 
Stop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStefan Bauer
 
Sass that CSS
Sass that CSSSass that CSS
Sass that CSSTrish Ang
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compassNick Cooley
 
Less(CSS Pre Processor) Introduction
Less(CSS Pre Processor) IntroductionLess(CSS Pre Processor) Introduction
Less(CSS Pre Processor) Introductionrushi7567
 
LESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionLESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionrushi7567
 
Introducing grunt, npm and sass
Introducing grunt, npm and sassIntroducing grunt, npm and sass
Introducing grunt, npm and sasspriyanka1452
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqDignitasDigital1
 
Bliblidotcom - SASS Introduction
Bliblidotcom - SASS IntroductionBliblidotcom - SASS Introduction
Bliblidotcom - SASS IntroductionIrfan Maulana
 
SASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetSASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetNeha Sharma
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentationJoeSeckelman
 
SPS Belgium - Stop your SharePoint CSS becoming a di-SASS-ter today!
SPS Belgium - Stop your SharePoint CSS becoming a di-SASS-ter today!SPS Belgium - Stop your SharePoint CSS becoming a di-SASS-ter today!
SPS Belgium - Stop your SharePoint CSS becoming a di-SASS-ter today!Stefan Bauer
 
Stop your sharepoint css becoming a disasster today spsbe2015
Stop your sharepoint css becoming a disasster today spsbe2015Stop your sharepoint css becoming a disasster today spsbe2015
Stop your sharepoint css becoming a disasster today spsbe2015BIWUG
 
Revamp Your Stylesheet
Revamp Your StylesheetRevamp Your Stylesheet
Revamp Your StylesheetGary Homidas
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LAJake Johnson
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sassKnoldus Inc.
 
Smart CSS theming with Sass and Compass
Smart CSS theming with Sass and CompassSmart CSS theming with Sass and Compass
Smart CSS theming with Sass and CompassMihaela
 

Ähnlich wie Sass conferencia css-sp (20)

Rh10 css presentation
Rh10 css presentationRh10 css presentation
Rh10 css presentation
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 
Stop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS Munich
 
Sass that CSS
Sass that CSSSass that CSS
Sass that CSS
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Less(CSS Pre Processor) Introduction
Less(CSS Pre Processor) IntroductionLess(CSS Pre Processor) Introduction
Less(CSS Pre Processor) Introduction
 
LESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionLESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introduction
 
Introducing grunt, npm and sass
Introducing grunt, npm and sassIntroducing grunt, npm and sass
Introducing grunt, npm and sass
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by Shafeeq
 
Bliblidotcom - SASS Introduction
Bliblidotcom - SASS IntroductionBliblidotcom - SASS Introduction
Bliblidotcom - SASS Introduction
 
SASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetSASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome Stylesheet
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
 
SPS Belgium - Stop your SharePoint CSS becoming a di-SASS-ter today!
SPS Belgium - Stop your SharePoint CSS becoming a di-SASS-ter today!SPS Belgium - Stop your SharePoint CSS becoming a di-SASS-ter today!
SPS Belgium - Stop your SharePoint CSS becoming a di-SASS-ter today!
 
Stop your sharepoint css becoming a disasster today spsbe2015
Stop your sharepoint css becoming a disasster today spsbe2015Stop your sharepoint css becoming a disasster today spsbe2015
Stop your sharepoint css becoming a disasster today spsbe2015
 
Revamp Your Stylesheet
Revamp Your StylesheetRevamp Your Stylesheet
Revamp Your Stylesheet
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LA
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
 
Smart CSS theming with Sass and Compass
Smart CSS theming with Sass and CompassSmart CSS theming with Sass and Compass
Smart CSS theming with Sass and Compass
 

Sass conferencia css-sp