Moroccanoil®, the global leader in oil-infused beauty, is thrilled to announce the NEW Moroccanoil Color Depositing Masks, a collection of dual-benefit hair masks that deposit pure pigments while providing the treatment benefits of a deep conditioning mask. The collection consists of seven curated shades for commitment-free, beautifully-colored hair that looks and feels healthy.| By Trevor Parsons | Article Rating: |
|
| October 24, 2014 10:00 PM EDT | Reads: |
5,853 |
Which CSS Preprocessor Should You Choose?
With the growing number of CSS Preprocessors like LESS, Sass, Turbine, Stylus andSwith CSS to name a few, it's hard to decide which to choose for your project, and which will provide the best CSS authoring.
Rather than focus on evaluating every CSS Preprocessor (that would simply take too long), we will focus on the two most commonly used in the industry:
Sass and LESS. We will provide a comparison on important deciding factors, like installation, features, and similarities & differences, to help you decide which is the best choice.

Before we begin comparing... If you don't know much about CSS Preprocessors, I would recommend you first read this article: Ten Reasons You Should be Using a CSS Preprocessor to understand how they can make your life easier.

Installation
Let's start with the first fundamental step, installation. Both Sass and LESS are built upon different platforms, Sass runs on Ruby while LESS uses a JavaScript library.
Installing Sass: Sass needs Ruby installed to work. This comes pre-installed with Mac, but in Windows you'll need to install before you can start playing with Sass. Further, Sass needs to be installed through the Terminal or Command Prompt.
There are several GUI applications you can use in place of the terminal, like (Scout,compass.app)
To install Sass on the command line, run:
| $ gem install sass |
Or with npm (node package manger):
| $ npm install sass |
To run Sass from the command line:
| $ sass input.scss output.css |
Installing LESS: LESS is built on JavaScript, so installation is as easy as linking JavaScript library to your HTML document. There also are a few GUI applications to help compile LESS to CSS, most of which are free and perform very well (e.g. CRUNCH, WinLess andLESS.app).
Alternatively, an easy way to install LESS on the server is with npm (node package manager), like this:
| $ npm install -g less |
To start the compiler from the command line:
| $ lessc styles.less |
Then, to run LESS from the command line, you can run:
| $ lessc styles.less > styles.css |
For a more comprehensive list of tools to compile LESS and Sass, look here, it covers a mix of both free and paid apps. There is a handy list of tools to make life a little easier when starting out with LESS or Sass, (25 Essential Sass and Less Tools).
Features
Here are the main features of Sass and LESS:
Sass |
Less |
| VariablesExtend
Mixins Nesting Import Operations Functions Loops Partials Compass
|
VariablesExtend
Mixins Nesting Import Operations Functions Loops Merge |
Similarities and Differences
You can see from the features list above, the difference between Sass and LESS is not huge. Both offer a good range of options to help you write smart and efficient code.
The major differences between LESS and Sass are Variables, Inheritance, Looping Logic and Compass.
Let me explain further.
Variables
Variables are used to pre-assigned values (like colors, margins, padding, etc.) anywhere in your stylesheet. This enables quicker access, but is repetitive to implement, and more importantly, update.
If you use a variable you only have to update in one place.
In LESS, variable names are prefaced with the @ symbol. In Sass, variable names are prefaced with the $ symbol. In both, the value is closed with a semicolon, which is typical for CSS.
Example:
| @myLessColor: #ff0087;p {color: @myLessColor;}__________________________$mySassColor: #ff0087;p {color: $mySassColor;} |
The only issue in this example is Less's use of the @ symbol.
The @ symbol already has assigned meaning in standard CSS, whereas the $ does not.
This can be confusing for beginners unfamiliar with the standards of the language yet.
Mixins, Inheritance & Extend
Mixins in Sass and LESS are defined a bit differently. In Sass we use the @mixin directive while in LESS we define it with class selector.
Here is an example:
Sass/Scss
| @mixin border-radius ($values) {border-radius: $values; } nav { margin: 40px auto 0; width: 760px; height: 35px; @include border-radius(5px); } |
LESS
| .border(@radius) { border-radius: @radius; } nav { margin: 40px auto 0; width: 760px; height: 35px; .border(5px); } |
Mixins in Sass and LESS are used to include properties from one ruleset to another. In Sass, this method is taken further with Selector Inheritance. The concept is identical, but instead of copying the whole property, Sass will extend or group selectors that have identical properties and values using the @extend directive.
Sass/Scss
| .module { padding: 10px; h3 { color: red; } }.news { @extend .module; } |
Sass/Scss
| .module { padding: 10px; h3 { color: red; } }.news { @extend .module; } |
Logic Statements
In LESS you can write a basic logic statement using a ‘guarded mixin' like this:
| .boxcolor(@colour) when (lightness(@colour) > 40%) { color: @colour; background-color: #000; .box-shadow(0 3px 4px #ddd); } .boxcolor(@colour) when (lightness(@colour) < 41%) { color: @colour; background-color: #fff; .box-shadow(0 1px 1px rgba(0,0,0,0.3)); } |
The equivalent in Sass, using if statements would be:
| @mixin boxcolor($colour) { color: $colour; @if(lightness($colour) > 40%) { background-color: #000; @include box-shadow(0 3px 4px #ddd); } @if(lightness($colour) <= 40%) { background-color: #fff; @include box-shadow(0 1px 1px rgba(#000,0.3)); } } |
Compass
Both Sass and LESS have extensions for faster and easier web development.
Sass: has Compass on it's side, which contains a plethora of Mixins to write CSS3 syntax in less time. Compass extends way beyond just CSS3 Mixins. It has added other useful features like Helpers, Layout, Typography, Reset and even Sprite Images. It also has config.rb file where you can control the CSS output and other utilities.
It is an extremely useful all-in-one package for web development with Sass.
LESS: LESS also has several extensions, but unlike Compass (which has everything in one place), they are separated. Each extension is built by different group of developers. This won't cause problems for seasoned users, but could be troublesome for those starting out.
Here are a few LESS extensions that you might need to include in your project:
- CSS3 Mixins: LESS Elements, Preboot, LESS Mixins.
- Grid: gs, Frameless, Semantic.gs
- Layout: less
- Misc: Twitter Bootstrap
Conclusion
The CSS Preprocessor you choose - Less or Sass - is determined by personal preference.
Depending on the nuances most important to your project, choose the preprocessor that seems best. My personal choice is Sass, simply because of compass and the @ symbol in LESS always bother me. But, I would highly recommend you try both out and decide for yourself.
You can download Less here and download Sass here.
Also, for a more in-depth comparison of the 2 languages, here is some further suggested reading.
Published October 24, 2014 Reads 5,853
Copyright © 2014 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Trevor Parsons
Trevor Parsons is Chief Scientist and Co-founder of Logentries. Trevor has over 10 years experience in enterprise software and, in particular, has specialized in developing enterprise monitoring and performance tools for distributed systems. He is also a research fellow at the Performance Engineering Lab Research Group and was formerly a Scientist at the IBM Center for Advanced Studies. Trevor holds a PhD from University College Dublin, Ireland.
Moroccanoil®, the global leader in oil-infused beauty, is thrilled to announce the NEW Moroccanoil Color Depositing Masks, a collection of dual-benefit hair masks that deposit pure pigments while providing the treatment benefits of a deep conditioning mask. The collection consists of seven curated shades for commitment-free, beautifully-colored hair that looks and feels healthy.Sep. 6, 2019 09:00 AM EDT |
By Zakia Bouachraoui The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today.
According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...Sep. 5, 2019 07:00 PM EDT |
By Zakia Bouachraoui The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today.
According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...Sep. 4, 2019 11:15 PM EDT |
By Zakia Bouachraoui We all love the many benefits of natural plant oils, used as a deap treatment before shampooing, at home or at the beach, but is there an all-in-one solution for everyday intensive nutrition and modern styling?I am passionate about the benefits of natural extracts with tried-and-tested results, which I have used to develop my own brand (lemon for its acid ph, wheat germ for its fortifying action…). I wanted a product which combined caring and styling effects, and which could be used after shampo...Sep. 4, 2019 11:00 PM EDT Reads: 311 |
By Elizabeth White The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...Jul. 1, 2019 07:30 AM EDT |
By Zakia Bouachraoui Jun. 27, 2019 08:00 AM EDT |
By Pat Romanski Jun. 24, 2019 06:00 AM EDT |
By Zakia Bouachraoui Jun. 17, 2019 01:00 PM EDT |
By Pat Romanski Jun. 15, 2019 08:15 PM EDT |
By Pat Romanski Jun. 15, 2019 01:00 PM EDT |


The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today.
According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...
The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today.
According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...
We all love the many benefits of natural plant oils, used as a deap treatment before shampooing, at home or at the beach, but is there an all-in-one solution for everyday intensive nutrition and modern styling?I am passionate about the benefits of natural extracts with tried-and-tested results, which I have used to develop my own brand (lemon for its acid ph, wheat germ for its fortifying action…). I wanted a product which combined caring and styling effects, and which could be used after shampo...
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...
"NetApp's vision is how we help organizations manage data - delivering the right data in the right place, in the right time, to the people who need it, and doin...
"We were founded in 2003 and the way we were founded was about good backup and good disaster recovery for our clients, and for the last 20 years we've been pret...
In his general session at 21st Cloud Expo, Greg Dumas, Calligo’s Vice President and G.M. of US operations, discussed the new Global Data Protection Regulation and how Calligo can help business stay compliant in digitally globalized world.
Greg Dumas is Calligo's Vice President and G.M. of US operations. Calligo is an established service provider that provides an innovative platform for trusted cloud solutions. Calligo’s customers are typically most concerned about GDPR compliance, application performance guarantees & data privacy.
Modern software design has fundamentally changed how we manage applications, causing many to turn to containers as the new virtual machine for resource management. As container adoption grows beyond stateless applications to stateful workloads, the need for persistent storage is foundational - something customers routinely cite as a top pain point. In his session at @DevOpsSummit at 21st Cloud Expo, Bill Borsari, Head of Systems Engineering at Datera, explored how organizations can reap the benefits of the cloud without losing performance as containers become the new paradigm.

























