I've a bilingual (Arabic and English) website built with nuxtjs and tailwind, arabic is rtl language.
tailwind.config.js file:
theme: {
extend: {
fontFamily: {
sans: ['Open Sans', 'sans-serif', 'Ubuntu'],
notoKufi: ['Noto Kufi Arabic'],
}
}
}
What I want to accomplish is changing the default font family in tailwind when user changes the locale/direction of the website.
I've read the docs, and tried Customizing the default font section and added this code to css
[style*="direction:rtl"]{
font-family: Noto Kufi Arabic
}
[style*="direction:ltr"]{
font-family: Open Sans
}
but nothing changed.
@apply font-sans;
rather thanfont-family: Open Sans
? Also, what do you see in the DOM? Is it not applied?@apply font-sans
, however I feel that the problem is to make font-sans refers to Open Sans when En is chosen and Noto Kufi when Ar is chosen, is there any way to accomplish this?