DEV Community

[Comment from a deleted post]
 
optimisedu profile image
optimisedu

getting? I conceded 2 days ago LMAO

 
acode123 profile image
acode123

Gust Van De Wal, I'll delete this post tommorow ASAP.

 
gustvandewal profile image
Gust van de Wal

If you do, please come back some day explaining the pros and cons of every CSS measurement!
Nothing you said has been wrong, it's just that this post only goes "There are pixels, and then there are viewport units. Maybe use viewport units more often?"

This only leaves us with ambiguity. People could end up avoiding px at all costs, because of the lack of context that has been given.

Your example of a 100px by 100px box to a 30vw x 30vh box, changes next to everything:

  1. The element goes from being a ratio of 1:1 to one of ?:?
  2. The element shrinks and grows vertically when scrolling on mobile, because of vh
  3. The first is of static size, the other is completely fluid

So,
Yes! You can and should mention using viewport units! They are amazing!
No! Nothing you in particular said is wrong!
But foregoing the explanation as to why you should do something, leaves the post impractical.

Think of a use-case, make up a good example, and post again. You'll see that when you actually explain things a bit in depth, people will be way more appreciative as a whole.

 
optimisedu profile image
optimisedu • Edited

Why - you say you use pure CSS. I'll presume a preprocessor don't see any reason not to use scss,less or stylus -anyway theme migration static, generatiin the right way

 
acode123 profile image
acode123

Good Point

 
acode123 profile image
acode123

Yeah.