Search This Blog

Monday, February 29, 2016

LESS css

Technology evolves but some times standards don't evolve fast enough and then people find "work around" to add the missing pieces to some standard while keeping the standard as is.

What am I talking about yet? Well in this case I'm talking about LESS or SASS. Those are 2 CSS compiler which add missing features to CSS. For example, ever wondered why you can't define a color once in your CSS file and then re-use it multiple times? Why is that missing? Well the 2 allows to do that. Ever wondered why you can't include files in your CSS? Again the 2 can do that.

At the end, what you cannot do with CSS and should be able had been mostly added to those compilers which at the end produce valid CSS files. The advantage is that the standard doesn't need to be modified, existing browsers will work out of the box with the new features and yet we do have support for those missing features. The drawback is that you need an additional step => compiling your CSS. A little price for how much it adds.

In my case it has even the bonus that I could let the user choose the color scheme of his/her dream and the CSS will be updated accordingly.

For me the main features of those compilers are:

  • Variables
  • File includes
  • Mixins
  • Nesting
Personally I prefer LESS to SASS as LESS sticks more to CSS than SASS, but that's mostly a question of taste. Both offer basically the same features.

In any case I would strongly suggest any web developer to at least have a look to them and ideally jump on one of the 2.

No comments:

Post a Comment