Less based on the framework language of node. js, it can be better and faster to build a website frame structure;
Then less adds CSS to the features of dynamic languages, such as variables, inheritance, operations, and functions. Less can be run on the client (ie 6+, Webkit, Firefox) or on the server with node. js or Rhino.
But for me to understand if he is convenient, I do not quite agree that although less design ideas biased towards the original, this if the use of the words are relatively easy to get started, so I summed up the following several advantages:
- The amount of code that needs to be written is significantly reduced. (high degree of reusability).
- CSS management is much easier, especially if you need to change the style of the site, and if you rewrite these styles directly, the work will be very large, but using less is easy, and changing to a global configuration board is fine.
- Less learning cost is not very high, and the CSS rules fully integrated, if you are familiar with CSS, then you will also be very quick to control the more.
- Using less for color matching will be very easy.
- Compatible with CSS3.
- And CSS can be very well fused to use. In the less code can be incorporated into the CSS code, in the CSS code can also insert less syntax
- You can combine projects with node. js.
However, no matter what is usually the pros and cons:
- You need to write a variable.
- Nesting too long can make readability much more
Then I wrote the code:
@base: #f938ab;. Box-shadow (@style, @c) when (IsColor (@c)) { Box-shadow: @style @c; -webkit-box-shadow: @style @c; -moz-box-shadow: @style @c;}. Box-shadow (@style, @alpha: 50%) When (Isnumber (@alpha)) { . Box-shadow (@style, rgba (0, 0, 0, @alpha));}. box { color:saturate (@base, 5); Border-color:lighten (@base, 30%); div {. Box-shadow (0 0 5px, 30%)}}
Less, although relatively easy to grasp, but still need to constantly update and understand, so as to better grasp a framework, although the beginning of a little conflict, feel that there is no CSS easy to use and intuitive, but this less code reuse rate is very high, but the premise to think and compile him, This requires prior understanding and planning.
Experience less CSS framework