简体   繁体   English

更少的CSS主题

[英]Less css with theme

I used LESS CSS for my CSS document. 我在我的CSS文档中使用了LESS CSS。 The website have different themes. 该网站有不同的主题。 In the head i put two CSS links. 在头部,我放置了两个CSS链接。 Like this: 像这样:

<!-- Theme -->
<link rel="stylesheet/less" type="text/css" href="static/css/themes/brabantzorg.less">

<!-- Global -->
<link rel="stylesheet/less" type="text/css" href="static/css/style.less">

I the theme less file. 我的主题较少文件。 I put the different colors for the thema in the theme less file. 我在主题较少的文件中为主题添加了不同的颜色。 I have a lot of different theme files. 我有很多不同的主题文件。

In the global css file. 在全局css文件中。 I put the global css with less. 我把全局CSS减少了。

But now i have a problem. 但是现在我有一个问题。 The less variables that i put in the theme less file. 我放入主题较少文件中的较少变量。 Are not working in style.less. 缺乏风格。 How can i fix this. 我怎样才能解决这个问题。 A example can you see here: Here 您可以在这里看到一个示例: 这里

The problem that less give: 少给的问题:

variable @color-paragraphs is undefined http://localhost/Regioportals/html/static/css/style.less on line 292, column 10: 在第292行的第10列上,变量@ color-paragraphs未定义http://localhost/Regioportals/html/static/css/style.less

LESS files don't share state. LESS文件不共享状态。

The variable @color-paragraphs , which you declare inside brabantzorg.less is no longer available when style.less is being processed. 在处理brabantzorg.less时,在style.less声明的变量@color-paragraphs不再可用。

What you need to do instead is @import brabantzorg inside style.less . 您需要做的是在@import brabantzorg内部style.less @import brabantzorg style.less

CSS是从上到下解释的,因此您必须将主题css放到全局的CSS之下

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM