Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Load different font depending on language of page

Solved by Natalia Bazilenco View solution

Started by Natalia Bazilenco 3 years ago · 3 replies · 422 views
3 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
3 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?

3 years ago

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

3 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 Marcel, 10 hours ago
0 16 10 hours ago
Support · by cvgrenoble, 3 days ago
3 82 3 days ago
Support · by Paul Hodges, 1 month ago
19 521 1 week ago
Support · by Lauw, 2 weeks ago
2 136 2 weeks ago
Support · by Anna, 3 weeks ago
4 445 2 weeks ago