Web Design

10 CSS Preprocessors Worth Considering

In this post we have have put together some of the best CSS preprocessors that are currently available, which do you use?

Portrait for Envato By Envato
Posted 10 Feb 2015
Web Design

If you have had anything to do with CSS, you must already be fully aware of the importance of a preprocessor. In simple words, a preprocessor brings peace of mind and ease of use to the coder's table. It lets you write code that is both future-ready and easily maintainable, thereby saving both your time and energy.

Of course, in simple CSS tweaks, a preprocessor might not always be needed. However, if you are dealing with gigantic stylesheets and numerous rules of style and code, a preprocessor can indeed come handy and improve your overall code manifolds, especially in terms of comprehension and legibility.

In this post, I have put together some of the best CSS preprocessors that are available out there.

1. Sass

Arguably the most well known CSS preprocessor out there, Sass has been around for nearly eight years, and as such, it is no minnow when it comes to preprocessors.

Sass requires Ruby to work with, and offers two syntaxes: the original Sass, and the relatively new but steadily rising in popularity, SCSS.

2. Less

Less is another popular CSS preprocessor that seeks to extend the default CSS syntax by means of mixins, variables and nested style rules. It is pretty easy to set up, as you just got to reference its JavaScript file in your HTML document.

Owing to its simplicity and reductionist approach, Less has attracted a very strong and loyal user base.

3. CSS-Crush

CSS-Crush ranks way behind Less and Sass in terms of popularity, but that shouldn't be an excuse for us to underestimate its ability. It comes loaded with everything you might ask for: variables, inheritance, nested rules, and so on!

4. Myth

Ever wanted to use a future CSS syntax without having to wait for web browsers and/or W3C to follow suit? If yes, Myth is the answer to your problems.

Basically, Myth lets you implement future CSS syntax without having to worry about browser support or specification statuses. Thus, when the given syntax does become available in browsers, you have zero need to rewrite your code.

Myth is based on Node.JS

5. Stylus

Stylus is a dynamic and robust CSS preprocessor that comes with its own plethora of custom functions, such as saturation().

Stylus also freely allows you to omit braces, semi-colons or colons, thereby making the code more presentation-friendly and readable.

6. DtCSS

DtCSS is another useful CSS preprocessor that comes with nested selectors, mixins as well as a smart caching system.

Plus, much like CSS-Crush, DtCSS too is based on PHP, and that means it can also be easily run on most common platforms and servers.

7. Rework

As the name suggests, Rework seeks to help those who, dare I say, wish to reinvent the wheel.

If you are someone who wishes to launch a CSS preprocessor of your own, Rework is probably the tool for you. Maybe, for example, Sass is too mainstream for you, or the syntax of Less and Stylus shouts "rookie" in your dictionary? Alternatively, you do not need a zillion custom functions or the bloated set of features that every preprocessor comes with, and are just looking for a simpler solution that sings to the tune of your own music? In either Rework is what you would use if you wish to write your own preprocessing rules or parsing functions.

8. Clay

Clay is a CSS preprocessor based on Haskell. As such, all its selectors and style rules are first class Haskell functions in their own right -- this makes reusability and composability pretty easy!

Clay supports nested style rules, media queries and anything else that you might expect from a CSS preprocessor. Since Clay is based on Haskell, you're gonna need a Haskell compiler in order to get it up and running.

9. Switch CSS

Switch CSS is a CSS preprocessor that runs under Apache. Therefore, you will need mod_python to be installed and enabled for Switch CSS to run.

Switch CSS comes with a GPL v2 license and has been coded in Python.

10. Compass

Compass is not just a CSS preprocessor. Instead, it pitches itself as a full-fledged CSS Authoring System.

Compass in itself is based on Sass, and is thus able to make use of all Sass features, such as variables, mixins and selector inheritance. It is highly popular and is under active development.

Which CSS Preprocessor Do You Use?

That brings us to the end of this roundup of CSS preprocessors. Which one do you actually use for your projects?