2 ms·
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 v
by esperent 5y ago
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
https://github.com/fisker/css-units-list/blob/main/index.js https://github.com/fisker/css-units-list/blob/main/index.js
- jdrc 5y agowhat about flex units fr etc? they dont count?
- esperent 5y agoPlease list any I missed. I only listed things you could set as width, height etc. There's also units like Hz and so on.
- onion2k 5y agoI 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).