SASS, Stylus, and other alternatives

As most readers probably know, or can easily imagine, LESS is not the only style sheet preprocessor language out there. As a matter of fact, it was released more than two years after Systematically Awesome Style Sheets (Sass), also known as SCSS, which had served the exact same purpose since 2007. Sass can offer basically the same set of features as LESS and came out first, so why shouldn't it be used instead?

Truth be told, no one will ever get fired for picking Sass or other viable alternatives, such as Stylus and Switch CSS, instead of LESS. We're free to choose the style sheet preprocessor we like the most, as long as we can use it without issues, meaning that our development framework--Visual Studio, for example--is able to support it. Luckily enough, all of them are now widely supported by many Visual Studio Extensions, so it won't make any significant difference.

Here's a list of some of the best extension tools that will provide support for LESS, Sass and/or other preprocessors:

  • Web Compiler by Mads Kristensen, an all-around tool to compile LESS, Sass, Stylus, JSX and CoffeeScript directly within the Visual Studio Solution Explorer (right-click | Web Compiler | Compile File).
  • LESS Compiler by Mads Kristensen, a lightweight alternative to the above which uses the official Node.js-based LESS compiler with no setup. Once installed, it will show a neat overlay in the lower-right corner of any LESS file opened with Visual Studio giving the developer the chance to turn the compile feature ON or OFF for the whole project and/or for the current file only; it doesn't support Sass.
  • CompileSass by Sam Rueby, another lightweight alternative that looks for all files with the .scss extension and compiles them in the background using LibSass, resulting in fast compile times; it doesn't support LESS.

Any of these tools will do, as long as it supports the standard you want to use; that said, for the purpose of this book, we'll pick LESS over Sass and other alternatives because we find it more straightforward, easy to use, and slightly more suited for a Windows environment than its counterparts, at least for now; we'll also install the LESS Compiler tool, so our LESS sources will be automatically compiled into CSS files on each build in the most lightweight way.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.241.250