本文介绍了在生产站点中使用less.js是一种不好的做法(针对LESS样式表的客户端javascript编译器)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此脚本基本上将.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:

  • 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编译器)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 20:28