SASS, SCSS, and LESS are CSS preprocessors that extend the functionality of regular CSS by allowing features like variables, nesting, mixins, and functions.
1. SASS (Syntactically Awesome Stylesheets)
- Older syntax of SASS (indented syntax, no curly braces or semicolons).
- File extension:
.sass Example:
$primary-color: blue body background-color: $primary-color
2. SCSS (Sassy CSS)
- Newer, more popular syntax of SASS that is fully compatible with regular CSS.
- File extension:
.scss Example:
$primary-color: blue; body { background-color: $primary-color; }
3. LESS (Leaner Style Sheets)
- Another CSS preprocessor developed by a different team, with similar features.
- File extension:
.less Example:
@primary-color: blue; body { background-color: @primary-color; }
Key Differences:
| Feature | SASS | SCSS | LESS |
|---|---|---|---|
| Syntax | Indented | CSS-like | CSS-like |
| Variables | $variable | $variable | @variable |
| Compatibility | Not with CSS | Fully compatible | Fully compatible |
| Popularity | Low | High | Moderate |
SCSS is the most widely adopted due to its familiar syntax and extensive community support.