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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Load different font depending on language of page

Solved by Natalia Bazilenco View solution

Started by Natalia Bazilenco 3 years ago · 3 replies · 304 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 Thomas, 1 week ago
2 64 18 hours ago
Support · by Anna, 3 days ago
2 68 20 hours ago
Support · by Justin Young, 21 hours ago
1 35 21 hours ago
Support · by Duc , 1 week ago
2 71 6 days ago
Support · by Colin Hume, 1 week ago
2 63 6 days ago