Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

younus's avatar

Change font size dynamically?

I am using Laravel 5.2 and used Laravel's localization feature to add support for my native language. Now the issue is that my native language's unicode fonts appear too small in the website. Is there a way, I can increase the global css settings for

tag when my native language gets loaded?

0 likes
2 replies
joedawson's avatar
Level 18

In your apps template, you could maybe add a class of the current locale to the body? Then style from there?

<body class="{!! app()->getLocale(); !!}">

Then you can style it accordingly where you need to.

body.en {
    font-size: 1.2em;
}

body.es {
    font-size: 1.6em;
}
5 likes
younus's avatar

Worked exactly the way I wanted it to. Thanks a lot for the help.

Please or to participate in this conversation.