Twitter | Pretraživanje | |
Thomas Steiner
Tip: Don't set absolute font sizes! If someone has their default browser font size bumped up/down, you override their choice and force them to zoom. 😔 Instead, set the font size to `100%` on the `:root {}` level and make everything a function thereof via `em` or `rem`. 🎉
Reply Retweet Označi sa "sviđa mi se" More
Thomas Steiner 18. pro
Odgovor korisniku/ci @matejlatin
Full credits to from whose article I have learned this from. We just fixed this issue on (pending deploy).
Reply Retweet Označi sa "sviđa mi se"
Aaron Peters 18. pro
Odgovor korisniku/ci @tomayac @mathias
So, using 1.1 rem in the root is bad?
Reply Retweet Označi sa "sviđa mi se"
Thomas Steiner 18. pro
Odgovor korisniku/ci @aaronpeters @mathias
By doing that, you override and upscale the user's chosen default font size, which typically is 16px, to 17.6px. You can do that, but maybe only above a certain screen size (or more hand-wavily: on "big" screens).
Reply Retweet Označi sa "sviđa mi se"
Filip Stanis 19. pro
Odgovor korisniku/ci @tomayac
I understand the rest, but I'm a bit confused about this: what's the purpose of setting :root to 100%? Isn't that the default?
Reply Retweet Označi sa "sviđa mi se"
Thomas Steiner 19. pro
Odgovor korisniku/ci @FilipStanis
It is the default, making it explicit mostly just makes sure you (or a CSS framework that you may include) don't set it to something else… ;-)
Reply Retweet Označi sa "sviđa mi se"
CJ Infantino 18. pro
Odgovor korisniku/ci @tomayac
Can’t you use “rem” which is a relative value based on the browsers set font size?
Reply Retweet Označi sa "sviđa mi se"
Thomas Steiner 19. pro
Odgovor korisniku/ci @cjinfantino
Yes, as long as you use `:root { font-size: 1rem; }`.
Reply Retweet Označi sa "sviđa mi se"
bruno (NOT Fernandes) 19. pro
Odgovor korisniku/ci @tomayac
Right. But this may cause content to overflow and you may get the ugly scrollbars
Reply Retweet Označi sa "sviđa mi se"
Thomas Steiner 19. pro
Odgovor korisniku/ci @theBashShell
If someone sets their default font size to very large, ugly scrollbars may be the least of their concerns…
Reply Retweet Označi sa "sviđa mi se"
Josh Goldberg 18. pro
Odgovor korisniku/ci @tomayac @mgechev
Oh wow so that's why we do that! Ty 😆
Reply Retweet Označi sa "sviđa mi se"