Do you recommend against LESS-based javascript?

After I watched this NetTUTs video , I am very interested in trying the LESS.js. method shown below.

Other than the obvious: "What if the user does not have javascript enabled?" or "There will be little success" ... is there a reason why this cannot be used in production?

Less is essentially what CSS should be ...

+4
javascript less
Jun 25 2018-10-06T00:
source share
3 answers

I see no reason why it should be used in production. It makes sense to run this as a build script, and then make the output (plain CSS) available in a cached domain without cookies. Then it works fine without JavaScript and does not require JavaScript processing (which will be slower than CSS parsers written in customized native code) each time the page loads.

+6
Jun 25 '10 at 0:37
source share

Yes, if people with Javascript disabled are worried, I would recommend against JESS based on LESS. Personally, I see no advantage in this over Ruby-based, since you really only need Ruby installed on your development machine - after compiling the .less file in .css, there is no difference between the LESS-compiled .css file and the โ€œhandwrittenโ€ one.

+2
Jun 25 2018-10-10T00:
source share

I have not tried in production, but there may be some interesting options for using LESS variables. For example, you can change below less variables, which, in turn, will change a bunch of CSS dependent rules (relative width / height, for example).

See https://stackoverflow.com/a/166268/ for more details on this interesting patch, which makes it easy to change them using the simple modifyVars() function.

With it, you can resize the Bootstrap grid and everything that depends on it with a single local JS call:

 less.modifyVars({ '@gridColumnWidth': 50px }); 
+2
Feb 28 '12 at 22:52
source share



All Articles