DEV Community

[Comment from a deleted post]
 
acode123 profile image
acode123

I am very sorry if you consider any part of my behavior "hostile". I don't believe this post is created for a hostile intention. I am not trying to avoid pixels, I am merely trying to state that using the px tool in css is not nessesarily the best option.

 
gustvandewal profile image
Gust van de Wal

Didn't I say I did NOT expect you to explain it to me, because I don't care about the usefulness of your trick and I have never said that.

Let me explain one last time:

  • This post, I assume is about avoiding px because it is unknown what real-life scale comes from it.
  • You say you use rem
  • OP says "em is also an alternative to using pixels"
  • I say "Which is just the same as using pixels"

Look at my first response to you, I explicitly ask whether we are talking about using alternatives to pixels.

Look at my second, I clarify things and end with a question to clarify a quote (which is still gibberish when I look at it).

IDK man. I feel like you're not actually reading everything I say carefully.
I would like cooperation, and that require you to answer questions, directly, also.

 
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.

 
optimisedu profile image
optimisedu • Edited

nah i'm trying to get him to block me because I have already conceded. It's funny isn't it getting his knickers in such a twist because he thinks he is cleverer than everybody else however hasn't actually made a point related to your article or the comments