Intro to CSS Variables (vgpena.github.io)
over 6 years ago from Violet Peña
over 6 years ago from Violet Peña
I find this site extremely hard to read
Great article! It helped me understand CSS variables much better.
Am i missing something? If you're making fallbacks with sass, whats the benefit/point:
sass fallback css in article: a { color: #7F583F; color: var(--primary, #7F583F); } but normal compiled sass using a var would be: a { color: #7F583F; }
Don't get me wrong this is a cool and much needed update, and the article is great. But i don't see the point (defining vars in media queries to one side) of using it if you're using sass.
We can do this natively in CSS now? Wow
yes!!! and browser compatibility is pretty solid! http://caniuse.com/#search=variables
I tried using this for a recent project. It breaks in IE. Unfortunately, the only reliable backup is just doing it the old way for now.
or use postcss-custom-properties
to auto-generate fallbacks!
the only reliable backup is just doing it the old way for now.
I disagree with this statement. Use @supports to progessively enhance with custom properties.
IE won't receive any updates, so we should stop using it as an excuse to not implement standards, instead we should try to adapt progressive enhancement approaches as much as possible.
Designer News
Where the design community meets.
Designer News is a large, global community of people working or interested in design and technology.
Have feedback?
Login to Comment
You'll need to log in before you can leave a comment.
LoginRegister Today
New accounts can leave comments immediately, and gain full permissions after one week.
Register now