Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Load different font depending on language of page

Solved by Natalia Bazilenco View solution

Started by Natalia Bazilenco 4 years ago · 3 replies · 493 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 webmasterodp, 1 week ago
4 166 1 week ago
Support · by nwhitfield, 1 week ago
2 143 1 week ago
Support · by stell, 3 weeks ago
5 376 2 weeks ago
Support · by gravinator, 1 month ago
5 570 2 weeks ago
Support · by Gravver, 3 weeks ago
6 355 3 weeks ago