Reputation: 23
I'm trying to use macros in a CSS file (in site manager-> development).
This is my CSS code:
@import url('/CMSPages/GetResource.ashx?stylesheetname=sitecss{$=|en-US=eng$}');
a, a:visited, a:active {
color:#407a1f;
}
....
This doesn't seem to work dynamically on the site as I switch between default culture and English.
The only time that it works is if I SAVE the CSS file (in site manager) while the site itself is in a certain culture.
In short: the macro "takes" the culture when the CSS file is saved and is not dynamic upon page loading.
How can I solve this?
THANKS :)
Upvotes: 0
Views: 1125
Reputation: 1400
In version 6 and later you can do it by
@import url('/CMSPages/GetResource.ashx?stylesheetname=sitecss{%CurrentCulture%}');
or you can directly resolve target CSS by
{% CSS["<stylesheet code name>"] %}
See more on http://devnet.kentico.com/docs/devguide/index.html?combining_stylesheets.htm
Upvotes: 0
Reputation: 17498
As far as I know, you cannot make you CSS code dynamic. However, you can do this easily as explained below:
Hope this helps.
Upvotes: 0