问题描述
此脚本基本上将.less
代码转换为.css
代码.我认为只有在用户关闭javascript的情况下,它才会引起问题,但是有很多人这样做吗?
This script basically turns .less
code into .css
code. I think it will only cause problems if the user has javascript turned off, but do many people do that?
有什么建议吗?
推荐答案
只需将.less
编译为.css
,然后再将其放入生产环境即可.这样,它仍将显示给未启用JS的用户,并且不会遇到@Plynx提及的问题.
Just compile the .less
into .css
before putting it into a production environment. That way it will still display to those without JS enabled, and won't suffer the issues @Plynx mentioned.
关于编译,有一些实时编译器,具体是:
As for compiling, there are some real-time compilers out there, specifically:
- 对于Mac- less.app
- 对于Windows- Less Parser
- For Mac - less.app
- For Windows - Less Parser
两者都保存时将.less
编译为.css
,这非常棒,并且使LESS易于使用!
Both compile .less
to .css
on file save, which is awesome, and makes LESS easier to use!
这篇关于在生产站点中使用less.js是一种不好的做法(针对LESS样式表的客户端javascript编译器)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!