Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Load different font depending on language of page

Solved by Natalia Bazilenco View solution

Started by Natalia Bazilenco 4 years ago · 3 replies · 589 views
4 years ago

Maybe to implement the task (a different font for the menu) - a separate template with a class for menu items or can it display a different header based on the version of the site language?

last edited 03/16/23 by Natalia Bazilenco
4 years ago

I understand that I need to work through twig files, but I don’t fully understand how to reconnect them. Ok, I copied the file modular.html.twig and renamed it to modular.en.html.twig
In this file for navigation -li- I add some class and set the font-family through css styles.
But how now to connect all this to the English version of the site in order to display the menu with a new font-family?

4 years ago

You could just load additional CSS depending on language, which would override the default theme font

4 years ago Solution

Thanks, great idea. I aded in my custom.css into child theme

TXT
:lang(en) {font-family: Aileron}
:lang(ro) {font-family: NatoSans}

I completely forgot about this method. Thank you.

last edited 03/17/23 by Natalia Bazilenco

Suggested topics

Topic Participants Replies Views Activity
Support · by TomW, 2 weeks ago
8 227 9 hours ago
Support · by alex, 2 months ago
8 667 23 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago