Secret ingredients to quality software


Do you always use a CSS preprocessor language over plain CSS, such as LESS or SCSS?

Last updated by Tiago Araujo on 16 Sep 2020 04:56 pm (8 months ago) See History

Writing CSS is easy. Writing a lot of CSS can become unwieldy and unmanageable. Using CSS pre-processors like LESS or SCSS helps you segment and organize your CSS logically and compiles down to regular CSS so there are extra steps to get up and running.

The key advantage of using CSS pre-processors is nested selectors. Instead line after line of specific CSS selectors you can nest them and they will compile down for you. Check out this example:

RulesLESS   css
Bad Example: Using regular CSS, you repeat yourself a lot

RulesLESS   less
Good Example: Using LESS, we can structure our CSS better

The pre-processed CSS then compiles to the regular CSS shown above.

We recommend using SCSS for its slightly more robust language scripting, however, the differences between LESS and SCSS are minor.

Ben CullBen Cull
Adam CoganAdam Cogan
Rebecca LiuRebecca Liu

We open source. This page is on GitHub