user1725382
user1725382

Reputation: 8532

LESS used in conjunction with culture codes

I am build a site that is multi-lingual and need to switch out some css on a page to handle different languages. I am pasing the culture-code into the page and I am looking for a way to use it to reference a different selector that would be used only for that language.I was wondering has anybody ever used LESS for this purpose. If you have any tips or tutorials, please post. Thanks

Upvotes: 1

Views: 73

Answers (1)

Nick Tomlin
Nick Tomlin

Reputation: 29231

I have not used it for this internationalization. But you can easily style things by adding your .culture-code class to the <html> element:

 /* default */
 body {
  background:white;
 }

/* these only apply to the body element when your culture code class is applied to the page */
.culture-code body {
  background:red;
}
.culture-code-2 body {
  background:blue;
}

If you are going to have very different stylesheets for each culture-code, you could create different less stylesheets, name them after the culture-code, and then use your backend language to import that stylesheet. But, hopefully you are only performing minor tweaks : )

Upvotes: 1

Related Questions