DEV Community

[Comment from a deleted post]
 
acode123 profile image
acode123

I am always open to discussion, I am sorry If I did not read your posts carefully. I do admit, I am new to CSS, and em is an alternative to pixels. I do not deny that I might be wrong, but I think you can agree with me that using pixels isn't very mobile friendly.

I see you have a point, and I am relatively new to CSS, and trust me, writing a fake article with fake informations will not get me anything.

 
optimisedu profile image
optimisedu

don't worry buddy the feeling is mutual

 
gustvandewal profile image
Gust van de Wal

Blogger and Programmer, I was talking to optimisedu...

This is all getting way too cumbersome, lol

Let's just put it to rest

 
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.