SlideShare a Scribd company logo
Sass conferencia css-sp
./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
Sass conferencia css-sp
File structure
Partials - Sub-files compiled in one single CSS file
@import - Defines the output order on the compiled CSS
./Features
Sass conferencia css-sp
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
Sass conferencia css-sp
- Key/Value data sets
- Unique list of keys
- Access to the keys and values
- Ability to iterate through these values
Sass conferencia css-sp
Sass conferencia css-sp
Sass conferencia css-sp
Sass conferencia css-sp
./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

More Related Content

PDF
Sass in 5
PDF
Testes de css
PPTX
Twelve-Factor application pattern with Spring Framework
PDF
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor Apps
PPT
SASS + COMPASS - Alta Produtividade no Front-end
PDF
European SharePoint Webinar - Make SharePoint Sassy
KEY
Advanced sass
PPT
Rh10 css presentation
Sass in 5
Testes de css
Twelve-Factor application pattern with Spring Framework
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor Apps
SASS + COMPASS - Alta Produtividade no Front-end
European SharePoint Webinar - Make SharePoint Sassy
Advanced sass
Rh10 css presentation

Similar to Sass conferencia css-sp (20)

PPT
Rh10 css presentation
KEY
Authoring Stylesheets with Compass & Sass
PPTX
Sass_Cubet seminar
PPTX
Stop your share point css become a di-sass-ter today - SPS Munich
PDF
Sass that CSS
KEY
Advanced sass/compass
PPT
UNIT 3.ppt
PDF
LESS(CSS Pre Processor) introduction
PDF
Less(CSS Pre Processor) Introduction
PPTX
Introducing grunt, npm and sass
PPTX
Sass:-Syntactically Awesome Stylesheet by Shafeeq
PPTX
Bliblidotcom - SASS Introduction
PPTX
SASS - Syntactically Awesome Stylesheet
PPTX
Joes sass presentation
PPTX
Stop your sharepoint css becoming a disasster today spsbe2015
PPTX
SPS Belgium - Stop your SharePoint CSS becoming a di-SASS-ter today!
PPTX
Revamp Your Stylesheet
KEY
Sass Essentials at Mobile Camp LA
ODP
Deep dive into sass
PDF
Smart CSS theming with Sass and Compass
Rh10 css presentation
Authoring Stylesheets with Compass & Sass
Sass_Cubet seminar
Stop your share point css become a di-sass-ter today - SPS Munich
Sass that CSS
Advanced sass/compass
UNIT 3.ppt
LESS(CSS Pre Processor) introduction
Less(CSS Pre Processor) Introduction
Introducing grunt, npm and sass
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Bliblidotcom - SASS Introduction
SASS - Syntactically Awesome Stylesheet
Joes sass presentation
Stop your sharepoint css becoming a disasster today spsbe2015
SPS Belgium - Stop your SharePoint CSS becoming a di-SASS-ter today!
Revamp Your Stylesheet
Sass Essentials at Mobile Camp LA
Deep dive into sass
Smart CSS theming with Sass and Compass
Ad

Sass conferencia css-sp