I used LESS CSS for my CSS document. The website have different themes. In the head i put two CSS links. 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. I put the global css with less.
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:
LESS files don't share state.
The variable @color-paragraphs
, which you declare inside brabantzorg.less
is no longer available when style.less
is being processed.
What you need to do instead is @import brabantzorg
inside style.less
.
CSS是从上到下解释的,因此您必须将主题css放到全局的CSS之下
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.