When comparing Less vs CSS-Crush, the Slant community recommends Less for most people. In the question“What are the best CSS preprocessors/postprocessors?” Less is ranked 3rd while CSS-Crush is ranked 14th. The most important reason people chose Less is:
Because Less has a lightweight feature set, is syntactically similar to CSS and can be run client side with file conversion on a page reload, it is easy to pick up by anyone familiar with CSS & the very basics of JS. Also, Less has detailed and well-organized documentation, GUI apps that can watch and compile code for you and a huge, active and helpful community.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Easy to learn
Because Less has a lightweight feature set, is syntactically similar to CSS and can be run client side with file conversion on a page reload, it is easy to pick up by anyone familiar with CSS & the very basics of JS.
Also, Less has detailed and well-organized documentation, GUI apps that can watch and compile code for you and a huge, active and helpful community.
Pro Familiar CSS style syntax
The LESS syntax is essentially the same as CSS with extensions for dynamic behavior such as variables, mixins, operations and functions.
Variables:
@color: #4D926F;
#header {
color: @color;
}
h2 {
color: @color;
}
Mixins:
.rounded-corners (@radius: 5px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
-ms-border-radius: @radius;
-o-border-radius: @radius;
border-radius: @radius;
}
#header {
.rounded-corners;
}
#footer {
.rounded-corners(10px);
}
Nested Rules:
#header {
h1 {
font-size: 26px;
font-weight: bold;
}
p { font-size: 12px;
a { text-decoration: none;
&:hover { border-width: 1px }
}
}
}
Pro Modern features and mixins
Less contains the base feature-set for a CSS preprocessor:
- Nesting
- Variables
- Basic mathematical operations
- Color functions
- @import
- Basic type functions
Pro Popular
Less is one of the most popular preprocessors due to being the easy to learn and its use in Twitter Bootstrap.
Pro Less is written in JavaScript
Many web developers are familiar with JavaScript and because Less is written in JS, it can be processed client side making the set-up easy.
Pro GUI apps
Apps such as Crunch, SimpLESS, WinLess, Koala, CodeKit, LiveReload or Prepros will watch and compile less.js for you.
Pro Good IDE support
IDEs such as VS Code, Visual Studio and WebStorm (and other JetBrains IDEs) support LESS either natively or through plugins.
Pro Out of the box vendor prefixing
Rather than require a plugin, CSS-Crush will automatically add vendor prefixes.
Pro Implemented in PHP
PHP is used in common platforms such as Drupal and Wordpress, which results in CSS-Crush being easy to integrate with most development stacks.
Cons
Con Less uses '@' to declare variables
The '@' symbol is used with Less to declare variables. However '@' already has meaning in CSS, as it is used to declare @media queries and @keyframes. This can result in some confusion when reading the code.
Con calc() requires interpolation
Con Limited support of conditionals
Less currently has limited support of conditionals such as ternary operators.
Con No custom functions
Less does not offer custom functions and instead requires the use of mixins. This is limiting in many ways - Functions cannot be called on shorthand values, they cannot return a value, and code needs to be repeated depending on where the mixin is needed.
Con Noisy syntax
Many unnecessary characters such as the following:
{}:;@
Con No loop and conditionals block
Con Not widely used
CSS-Crush is not a widely used option. The small community of users results in a harder time finding answers to any questions you may have.