re: The new (and old) CSS units you've never heard about VIEW POST

VIEW PARENT COMMENT VIEW FULL DISCUSSION
 

vmin and vmax are actually as old as vw and vh, both on Level 3. Not many use cases, but there are some! They're especially useful for responsive layouts and font sizing.

Some trivia about them:

  • IE never supported vmax, and Edge started to support it only recently; a way to emulate it was using calc. E.g. if you wanted 15vmax, you could do calc(15vw + 15vh - 15vmin) - not really handy, though.
  • IE9 used vm instead of vmin, together with a completely wonky implementation of all these viewport units.

They're great units, unfortunately they lose a lot of value due to inconsistencies among mobile browsers (I'm looking at you, Safari).

 

I used to like vh/vw. Until I discovered that Safari scaled them with zoom. So if you are zoomed at 85%, 100vw becomes 85% of the width of the page which is now equal to 72.2% of its original size.

I don't know who thought that made any sense and it seems to be the only browser that behaves that way :\

 

Oh, I see.

It's a shame that it's not implemented consistently, which often seems to be the case with CSS.

code of conduct - report abuse