Do we need to provide all variables with cssVars.variables? (IE11)
See original GitHub issueI have created a small Angular sample application including css-vars-ponyfill that I’m currently testing on IE11. It contains a title, a button to toggle the fontweight of the title, and a colorpicker to change the color of the title.
cssVars is initialized by calling:
cssVars({
watch: true,
onlyLegacy: true
})
The variables are:
--fontWeight: bold;
--fontColor: red;
In the methods to update the color or title I simply call e.g. cssVars(variables:{"--fontColor", "blue"});
to update the color. Which works fine, but everytime I update one of the variables, the other gets reset to it’s original value!
Is is necessary to call cssVars with variables containing all variables? This would be a bit of an overkill for larger applications…
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (5 by maintainers)
Top Results From Across the Web
IE11 - does a polyfill / script exist for CSS variables?
Yes, so long as you're processing root-level custom properties (IE9+). GitHub: https://github.com/jhildenbiddle/css-vars-ponyfill ...
Read more >How to use CSS custom properties (a.k.a. variables)
Note: CSS variables are not and won't be supported in IE11. You can either create a static stylesheet for all UA browsers or...
Read more >CSS variables (Custom Properties) polyfill for IE11
It searches for all rules containing variable getters and setter, remembers the affected selectors so future affected Elements can be found in a...
Read more >CSS Variables (Custom Properties) | Can I use... Support ...
CSS Variables (Custom Properties). - CR. Permits the declaration and usage of cascading variables in stylesheets. Usage % of. all users, all tracked ......
Read more >Why I Don't Use CSS Variables
CSS variables, officially called Custom Properties, are amazing. I want to use them, but I can't. Because IE11 doesn't support them.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Selupsis, @nkamenar, @itsthechad –
I have fixed this issue and will publish an update very soon.
For those interested, the issue was more complex than the workaround (#110) provided by @itsthechad would suggest. The workaround forced
options.variables
values to always persist, which breaks ponyfill calls made whenupdateDOM
isfalse
. This probably seems like an edge case, but it’s critical for supporting web components sinceupdateDOM:false
is used under the hood to process shadowRoot:root
declarations without affecting the regular DOM.Thank you for your patience with this issue and apologies (again) for the slow response. Special thanks to @itsthechad providing the workaround while I was navigating the relocation!
@itsthechad Thanks for the workaround, I can confirm that it works. I’ll be using it until there will be a patch for this issue ^^