1 / 10

CSS PREPROCESSORS

CSS PREPROCESSORS. Michael and Miles. Overview. What are CSS Preprocessors Why use them? What is LESS and how to use LESS example What is SASS and how to use SASS example. What are CSS Preprocessors. Tools for development Language  compilation  CSS

joelle
Download Presentation

CSS PREPROCESSORS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSS PREPROCESSORS Michael and Miles

  2. Overview • What are CSS Preprocessors • Why use them? • What is LESS and how to use • LESS example • What is SASS and how to use • SASS example

  3. What are CSS Preprocessors • Tools for development • Language  compilation  CSS • Gives more functionality to CSS • Dynamic style sheets • CSS properties as variables • Fewer lines of code

  4. Why use preprocessors? • Developers turning to toolkits • Create more manageable, reusable, compact style sheets • Faster development time • Saves from monotony • More time for creativity and back-end development • Programmatic CSS features

  5. LESS • Inspired by SASS • Developed by Alexis Sellier in 2009 • Originally in Ruby on Rails, replaced by JavaScript • Open source on GitHub • Uses stylesheet.LESS extension • JavaScript compiles LESS code into regular CSS on the fly • variables, mix ins, operations and nested rules • Nice debug feature

  6. Variables in LESS, use the @ symbol • @maincolor: #232323 • Global styles • Define once, use anywhere • Change once, update everywhere • Mix-ins • Classes injected into other classes • Reusable snippets of code • Optional parameters • Nesting • Gives your CSS hierarchy • Stack child elements into parent element • Operators

  7. SASS • Created by Hampton Catlin • Further designed by Nathan Weizenbaum and Chris Eppstein • Uses .SCSS or .SASS extensions • Must be compiled into a CSS file • Variables, if else statements, loops, mix ins, etc. • 100% CSS3 compliant

  8. Two syntaxes, who can live at this speed? • Indented syntax (.SASS) • Much different from traditional CSS syntax • No curly braces or semi colons • More strict • Sassy CSS (SCSS) • Superset of CSS • If you know css, already writing in SCSS • Easier to work with existing CSS • Both are completely valid and neither will be depracated

  9. Summary • LESS and SASS features • Dynamic style sheets • Faster development • Less code • Reusability

More Related