My question came up after read this question and its answers .
Many IDEs provide ways to compile LESS code still in development. In Netbeans, for example, you can always set up the .less
code to be saved, compiled, and generated in CSS. In projects I need to use some preprocessor I create a structure similar to this:
/assets
/style
/css
| style.css
/less
/build
style.less
| variables.less
| mixins.less
When the style / less / build directory code is saved, a .css
file is automatically created in / style / css .
Then, in HTML, just reference the location of the style sheets, for example:
<link rel="stylesheet" href="assets/style/css/style.css"/>
For me this would be the best way, instead of letting this processing be done on the client device I would need:
I'm just using LESS, but I only see this practice being advantageous if by chance a LESS file is lighter than a CSS (and look there).
So, my doubts:
- Is a
.less
file lighter than.css
? - When compiling the code on the user's computer is the best choice?
- What benefits / harms I have when I choose to compile
.less
client side?