Click the image to get to the free full-length CSS Variables course.
If you haven’t heard of CSS Variables before, it’s a new feature of CSS which...
For further actions, you may consider blocking this person and/or reporting abuse
The only issue related with css variables is IE (every time is IE the problem) compatibility.
I prefer to use vars only with SCSS, because I need to give IE compatibility for my projects.
Anyway nice examples, I love the new css grid system, expecially if combined with flexbox!
You can try this polyfill:
github.com/nuxodin/ie11CustomPrope...
Also, CSS variable can't be rendered by Opera Mini with extreme mode. We have to use normal mode to render CSS variable with Opera Mini.
Consider than I've never tested it on a mobile browser because is still a WIP, anyway thanks for the feedback.
You absolutely nailed the fundamental advantage of CSS custom properties in this tutorial. Taking it a step further, pairing those root variables with the
clamp()function completely eliminates the need to redefine them inside media queries. You set a fluid typography range once at the root level and let the browser handle the math across viewports automatically. It makes maintaining responsive layouts across complex component trees vastly more predictable.This is exactly the post I needed today. Thank you!
"The only issue related with css variables is IE (every time is IE the problem) compatibility.
I prefer to use vars only with SCSS, because I need to give IE compatibility for my projects.
Anyway nice examples, I love the new css grid system, expecially if combined with flexbox!" by Nicola. ->>me too
Or you could use this exact same approach with the rem unit and have better browser support.
Thanks a lot, this was really helpful because I've been struggling with responsiveness for a while now. Didn't realize how powerful CSS variables are.
Great post! I've just started messing with CSS Variables and hadn't thought of using them this way. It's so much cleaner and IMO makes responsiveness much less daunting.
Awesome article. Variables are the way to go! Forget IE! 😝
When a 2 minutes read beats rage-quitting.
Thank you!
Assigning css variables with media queries.. Bloody brilliant! Never thought of that. :)
Thanks!