LessCSS停止处理样式 [英] LessCSS stops processing styles

查看:162
本文介绍了LessCSS停止处理样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在JS模式(less.js)中使用Less,方法如下:

I'm using Less in JS mode (less.js) the following way:

<link rel="stylesheet/less" href="assets/styles/less/bootstrap.less" media="all">
<script src="assets/scripts/libs/less-1.1.5.min.js"></script>

在一些页面查看后,它停止处理样式并提供缓存版本。为了使它重新解析样式,我必须清除浏览器cookie。有人知道为什么是这样吗?是否有任何选项,使其在每个页面视图重新解析?
非常感谢!

And after some page views, it stops processing the styles and gives a "cached" version. To make it re-parse the styles I have to clear browser cookies. Does anybody knows why is this? Is there any option to make it re-parse on every page view? Thanks a lot!

UPDATE:查看一些库代码,似乎使用localStorage将样式表存储为缓存。它基于文件的最后一次修改时间来更新该缓存,但由于某些原因,它不能正常工作,因为它没有采取我的更改...

UPDATE: Reviewing some of the library code, seems that it uses localStorage to store the stylesheets as a cache. It bases on file's last modified time to update that cache but for some reason it's not working properly because it's not taking my changes...

推荐答案

为此,我在GitHub上找到了一个问题。引用自己:

I just found a issue in GitHub for this. Quoting myself:


这也发生在我的1.1.5。脚本使用localStorage存储样式表。清除浏览器缓存无效。您必须清除它的cookie(注销所有的帐户,%!@ ^#%)或执行localStorage.clear()。我在加载less.js之前使用此方法(不使用localStorage自己):

This happens to me also in 1.1.5. The script uses localStorage to store the stylesheets. Clearing your browser cache won't work. You must clear it's cookies (logging off all your accounts, %!@^#%) or doing localStorage.clear(). I use this before loading less.js (not using localStorage myself):



<script> /* Provisory for dev environment: */ localStorage.clear(); </script>




当生产时,你只需要将样式表编译为.css


When going to production you just compile the stylesheets to .css

这篇关于LessCSS停止处理样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆