在生产环境中为 less.js 保留 .css 后备真的很重要吗?

发布于 2025-01-05 23:42:38 字数 210 浏览 6 评论 0原文

我正在研究 less.js,用于在客户端站点上进行开发和生产。它如何扩展 CSS 真是太神奇了,对我来说,使用它时速度并没有太大差异。

我想知道为 less.js 保留 .css 后备文件是否真的那么重要?我确信如果用户在没有启用 JavaScript 的情况下进行浏览,那么他们无论如何都无法浏览很多其他网站。你怎么认为?这真的重要吗?

有人说这不适合生产,但这是真的吗?

I am getting into less.js, for development and production on client sites. It's amazing how it can extend CSS, and for me there isn't really that much difference in speed when using it.

I'm wondering if it's really that important to keep a .css fallback file for less.js? I'm sure if a user is browsing without JavaScript enabled, then they wouldn't really be able to browse much other sites anyways. What do you think? Does it really matter?

Some say it's not mean't for production, but is that true?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江湖正好 2025-01-12 23:42:38

如果你使用 less 我建议你将 less 文件预编译成 CSS 文件。在客户端依赖 less 来解析 css 文件会引入另一个失败点。

在他们的网站 http://lesscss.org/ 上有很多如何执行此操作的示例。

如果您使用 .NET,您可以使用 T4 模板< /a> 或者您可以使用 DotLess 它使用 httphandler 在 Fly 服务器端编译 less 文件。

If your using less I suggest you precompile your less files into CSS files. Relying on less to parse your css files on the client side is introducing another point of failure.

On their website http://lesscss.org/ there are plenty of examples of how to do this.

If your using .NET you can use T4 Templates or you can use DotLess which uses an httphandler to compile the less file on the fly server side.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文