Curious about double font-size in gov.uk typography styles

Hey everybody, I was at a meeting with my team (UX) and a colleague presented some work based in gov.uk. Cheking with the inspector we found that in most cases for the typography styles they use font-size twice. First in pixels and then in rem. Like this (some selectors omitted for the sake of the question):
.govuk-heading-l{
font-size: 36px;
font-size: 2.25rem;
}
.govuk-heading-l{
font-size: 36px;
font-size: 2.25rem;
}
So, the first font-style will always overwritten by the second. It wouldn't be because of different browsers, like with box-shadow or other styles. So my question is... Why does gov.uk do this? Readability? Thanks for your time
4 Replies
~MARSMAN~
~MARSMAN~β€’16mo ago
My guess is to cover browsers that don't support rem? Like the old versions of safari, IE, opΓ©ra, etc.
WoolHat
WoolHatOPβ€’16mo ago
Thanks, I'll keep the thread open if anyone else has another guess.
Chooβ™šπ•‚π•šπ•Ÿπ•˜
The rem unit was not supported until 2010. That may seem ancient for you, but government sites are fundamentally different from other sites. They are required by law to be as accessible as possible to everyone, even if they have ancient computers. This is also why such sites tend to look like they were built in the 1990's. It's not just a lack of available funding to pay web developers. They must build their sites for maximum compatibility, even if that makes the site look ugly. Also, funding is an issue for government projects like this, so the CSS that you see might have been written during the initial transition to rem in 2010, and nobody ever revised this portion of the code. There is also a lot of bureaucracy involved in approving changes, so it's entirely possible that nobody wanted to go through that headache just to remove legacy code that isn't causing harm.
WoolHat
WoolHatOPβ€’16mo ago
I think you are right. Thanks for going for such a detailed explanation.
Want results from more Discord servers?
Add your server