Join Joe Marini for an in-depth discussion in this video What are LESS and Sass?, part of CSS with LESS and Sass.
Now, you might be thinking to yourself, why do we even need LESS and Sass, and what are…they, and why isn't CSS good enough?…CSS seems to be a pretty stable styling language; it's been around on the Web for a long time now.…So what's up with LESS and Sass? What's so great about them?…Well, I wouldn't blame you for thinking that; CSS is a pretty great language, but it does…have some drawbacks.…First, there is no way to specify variables in CSS; these are values that you define…once, and then reuse them throughout a style sheet.…So for example, if you define a color value, and you want to use that in multiple places,…you have to then put that exact color value, literally, in a whole bunch of places in your style sheet.…
And if you want to go back and change it later, you may have multiple, maybe even hundreds…of places where you need to change that color, and LESS And Sass help us solve that problem.…CSS also has no way to define and reuse common style rules.…So you can imagine that your Web site might have some common attributes, like border thicknesses,…
The first section focuses on LESS (Leaner CSS) and how it can be used on both the client and the server. The lessons show how to work with variables, mixins, nested rules, and other features to easily create maintainable CSS.
The second section introduces Sass (Syntactically awesome stylesheets), which contains many of the same features as LESS, along with a few new ones. Joe also compares and contrasts the two tools, and explains how your platform and needs may influence which tool you choose.
- What are LESS and Sass?
- Using variables in your CSS
- Working with reusable and parameterized mixins
- Implementing nested rules
- Combining CSS rules with operations
- Using the built-in functions in LESS and Sass
- Controlling the CSS output formatting
- Importing external files