We all know that CSS used to be the most challenging part of web development. However, it has become even harder nowadays.
You wouldn't believe it...
For further actions, you may consider blocking this person and/or reporting abuse
What's about credits for the inventor of this technique? Temani Afif - css-tip.com/screen-dimension/.
Thank you for pointing this out! The article was based on an internal technical sharing, and the inventor was unintentionally omitted. We'll do our best to avoid such oversights in the future. 🫡
This code is a poem
I think you mean window size, right?
Never window size.
Delete this word from your mind and replace it with
viewport
Thanks for pointing that out!👏 Fixed it.
Is it possible to use
calc
instead of tan * atan2 trick? Whatever, great article!Is it supported on all current browsers
that's cool, thanks for sharing
hmm. Interesting. But in which cases I can use it?
In no case, but it is useful when you want to know the size of your screen's viewport just by visiting the demo page.
Awesome!!!
caniuse.com/?search=%40property
if im not wrong. thats not support for safari 16.3<
Wow, how clever !
is possible to create one generic css and reuse it inside component? like Angular.
for example insert one div:
where I need to mesure
It's a very nice solution!!
Genius!
This is gold.
Would be possible to calculate some element height, like headers with this instead of using javascript?
I'm curious to see what else is possible with the new @property featured in CSS