Mike Vierwind
Mike Vierwind

Reputation: 1520

Less css with theme

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:

Upvotes: 0

Views: 1185

Answers (2)

AMIB
AMIB

Reputation: 3430

CSS is interpreted top to bottom so you must put the theme css below global one

Upvotes: 0

thirtydot
thirtydot

Reputation: 228162

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.

Upvotes: 1

Related Questions