Re:Interop 2022: browsers working together to improve the we...
by onion2k on Sunday March 06, 2022 @03:11PM
(#30580777)
Apart from the duplicates (cm, inches, etc which can all be derived from mm with a basic calc) they all do different things. vw, vh, vmin, and vmax are useful for filling a screen, px is obviously related to the screen size, em, rem, ch and lh are relative to the current font or root font. There isn't much clutter there.
[ Parent
| on HN ]
Re:Interop 2022: browsers working together to improve the we...
by esperent on Sunday March 06, 2022 @07:45PM
(#30582812)
You're missing quite a few. Here's all the size related CSS units I could find:
em
rem
ex
rex
cap
rcap
ch
rch
ic
ric
lh
rlh
vw
vh
vi
vb
vmin
vmax
And soon also:
dvh
lvh
svh
Taken from here
Re:Interop 2022: browsers working together to improve the we...
by onion2k on Monday March 07, 2022 @02:12AM
(#30585006)
I was illustrating how most of them aren't clutter. They do different things. This list just goes further to show that point - all the text related units refer to different aspects of the text, and they all need root and local versions. Same for screen space units like vw, vh, and so on. Any unit where you can't derive one from another means you need both.
There are some where you can do that. Absolute lengths like mm, cm, inch etc could just be one unit. Same for deg, rad and turn. Mostly though, CSS units are very well thought out, and it's easy to understand why the length units are included (USA vs metric).