Osama El-Masri
Osama El-Masri

Reputation: 164

How to apply different style sheets based on the language?

I am using Angular Internationalization (i18n) to translate a website from English to Arabic and vice versa. Since Arabic is an RTL language and English is an LTR language, I need to load different stylesheets depending on the locale. Is it possible to do so?

Upvotes: 0

Views: 404

Answers (1)

Caio Oliveira
Caio Oliveira

Reputation: 844

If you don't want to use any javascript, you could just use the attribute selector and encapuslate your styling under the scss file.

Anything that you wan't different for RTL you can apply after

<p>Left to right</p>
<p dir="rtl">Right to left</p>
p {
  color: red
}

p[dir="rtl"] {
  color: blue
}

Upvotes: -1

Related Questions