How to Choose the Best CSS Preprocessor

Postat pe - Modificat ultima dată pe

If you are doing anything serious with CSS then you probably already know all about CSS Preprocessors and have pre-formed opinions on the best ones to use. If you don't know about CSS Preprocessors, where have you been? CSS Preprocessors are one of the best tools in a coder's toolbox. While there has always been resistance to using them, those who have realized how powerful these tools are know that they have become a real boon!

 

CSS Preprocessors are gaining in popularity precisely because they can save developers huge amounts of time by taking away the need to do all the tedious grunt work. Lots of extra functions are added like nesting selectors, Math functions, and referencing a parent selector. With all these advantages, there's no reason not to use them.

 

For ultimate peace of mind and ease of use though, you'll need to choose the right tool.

 

Sass

Sass is probably the best-known tool available at the moment. Requiring Ruby, it is a well-established and competent development tool that developers have been using for eight years. As such, this open-source project is a mature tool and one that has come to define the whole idea of a modern CSS preprocessor. SCSS, its newer syntax, is also much closer to native CSS, making it even better and easier to use than before.

 

Less.js

Written in JavaScript, this is a great little preprocessor can extend CSS with dynamic behaviour. Suddenly, variables, mixins, operations and functions are within easy grasp. There's a smaller  learning curve with Less.js compared to others. It's also a good one to try if you are uncomfortable, or just coming around to the idea, of using a CSS preprocessor.

 

CSS-Crush

While much less popular than Less.js and Sass, CSS-Crush doesn't lack features. CSS-crush comes with everything you could ever ask for from a fully-featured preprocessor: variables, nested rules, inheritance tables, and much more. The biggest draw of CSS-Crush is that it makes heavy use of PHP.  The huge popularity of PHP means that it can be run on even the simplest common server shared hosting account!

 

Myth

This is a fantastic CSS preprocessor that allows you to future-proof your syntax without having to worry about features being eventually dropped or features that are not yet widely supported. This is a good feature because it means you only have to code once, and then leave it as there is no need to laboriously update the code every time a new syntax is released. Node.js is required to run Myth.

 

CSS Preprocessors are worth incorporating into your workflow, despite the initial time that you have to invest in learning it. Ultimately, the best way to know which one is the best for you is to try a few out (the four above are a great start!) and choose one that suits your workflow. To slowly integrate these into your project, you can simply change the '.css' file extension in your stylesheet, then refactor your code with variables or mixins for repeating sections.

 

Postat: 23 martie, 2015

Happymarli

Proofreader, Editor, Writer and App Developer

Do you need a professional editor and writer to proofread your technical documents, thesis, novel, statement of purpose, personal statement, resume, cover letter, manuscript, essay, short story, textbook content, or articles? Do you want to make sure that your marketing material content is flawless and appealing to readers? I can do any of that! I am a professional editor (academic, copy, line/su...

Următorul articol

Tips for Travel Writing