gpt4 book ai didi

less - 如何在浏览器中编译 LESS 文件

转载 作者:行者123 更新时间:2023-12-04 01:57:27 25 4
gpt4 key购买 nike

我创建了使用 LESS 功能切换主题的代码。不幸的是,LESS 文件不会在浏览器中编译。如何在浏览器中编译 LESS 文件?

最佳答案

这是一张documentation :

Client-side usage

Link your .less stylesheets with the rel set to “stylesheet/less”:

<link rel="stylesheet/less" type="text/css" href="styles.less">

Then download less.js from the top of the page, and include it in the <head> element of your page, like so:

<script src="less.js" type="text/javascript"></script>

Make sure you include your stylesheets before the script.



所以,你需要:
  • 地点 link标签 之前 script标签
  • 套装rel“stylesheet/less”
  • 请注意 bug in chrome
  • 关于less - 如何在浏览器中编译 LESS 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10554462/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com