Download presentation
Presentation is loading. Please wait.
Published byRonald Cook Modified over 9 years ago
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
5
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
6
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
7
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
8
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
9
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
10
Summary LESS and SASS features Dynamic style sheets Faster development Less code Reusability
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.