Web Dev Academy CSS styling · Sass / SCSS & Less Tool 8 / 64
CSS styling

Sass / SCSS & Less

CSS preprocessors. They add variables, nesting, mixins and loops to CSS, then compile it all down to the plain CSS browsers understand. SCSS is Sass's CSS-like syntax; Less is a similar, JavaScript-based alternative.

Demo 01

Live SCSS → CSS compiler

This runs the real Sass compiler in your browser. Edit the SCSS on the left — with a variable, nesting, a mixin and a @for loop — and watch it compile to plain CSS on the right in real time.

SCSS (you write this)

Compiled CSS (browsers run this)

Loading the Sass compiler…
Demo 02

Variables & nesting

Variables ($brand) keep values in one place; nesting mirrors your HTML structure so selectors read top-down. Load this snippet into the compiler above to see how nested rules flatten into normal CSS selectors.

Demo 03

A @for loop generates a colour scale

Preprocessors can compute CSS. The loop below emits five spacing utilities and a tint scale from a single line. Load it, then watch the swatches below render from the compiled output.

Demo 04

Mixins — reusable chunks of CSS

A @mixin is a parametrised block you @include wherever you need it — like a function that returns CSS. Load this to see one mixin expand into several full rule-sets.

Demo 05

And Less?

Less covers the same ground — variables, nesting, mixins — with slightly different syntax. Variables use an @ sigil instead of $, and mixins are just regular classes you call by name. The big practical difference is that Sass became the de-facto standard, while Less powered older Bootstrap 3.

// Less syntax
@brand: #6d5efc;
.card {
  color: @brand;
  .title { font-weight: 700; }   // nesting
}
.rounded(@r: 8px) { border-radius: @r; }  // mixin
.box { .rounded(12px); }                   // call it
i
The live compiler uses the real Dart-Sass engine compiled to JavaScript (sass.js) running entirely in your browser — what you type is genuinely compiled by Sass, not faked. A little vanilla JavaScript wires the editor to the compiler and renders the swatch preview. If the CDN ever fails to load, the panel shows a clear error instead of pretending. The Less section is illustrative code. Shared CSS shell styles the page.

↑ All 64 tools