-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IE11 getComputedStyle does not report custom properties correctly #2
Comments
Oh, that’s a good point. Will need to think about (auto) absorbing root values for IE11 (in a performant manner) 🤔 |
Did a quick test with this library: It looks like it's able to provide IE11 with the ability to set and read For the purposes of this plugin, that's all we really need 🙏 Unsure how performant and viable this solution is though |
The theory looks sound, but I can see one major issue (sort of unavoidable, tho) that technically the I've used
|
This library uses
window.getComputedStyle(document.documentElement).getPropertyValue('--custom-prop')
to find the value to replace thevar(--custom-prop)
with.Unfortunately, this doesn't work in IE11 (as I just found out). So we fixed the plugin running in IE11 with #1, but unfortunately it still can't figure out the correct value. It does grab the fallback value in the form of
var(--prop, fallback)
correctly. It just cannot find the real value.I know that
css-vars-ponyfill
has its own css parser, which is how it gets around IE11's limitation. Unless I'm doing something wrong (a definite possibility), this is gonna be an issue.....Minimal demo:
Chrome Output:
value of '--test': " red"
IE11 Output:
value of '--test': ""
The text was updated successfully, but these errors were encountered: