jhildenbiddle / css-vars-ponyfill

Client-side support for CSS custom properties (aka "CSS variables") in legacy and modern browsers
https://jhildenbiddle.github.io/css-vars-ponyfill
MIT License
1.46k stars 64 forks source link

Am i missing something for use in Angular 10+? #163

Closed Yolo-plop closed 3 years ago

Yolo-plop commented 3 years ago

Hello,

I followed this example, which seems pretty straightforward and not much chances to do something wrong: https://stackoverflow.com/questions/55576987/working-with-var-css-in-internet-explorer-using-angular-7

But it does not work in Internet Explorer 11. Am i missing something?

Thanks

jhildenbiddle commented 3 years ago

Hi @Yolo-plop.

Import and call the ponyfill in your ponyfill.ts file:

https://codesandbox.io/s/css-vars-ponyfill-163-kjbgx?file=/src/polyfills.ts

Note that I've set onlyLegacy to false to allow the ponyfill to treat modern browsers as legacy browsers. This is to allow testing on modern browsers since debugging in IE11 is so painful. For production, you would want to set onlyLegacy to true (or omit this line since true is the default value) to ensure that the ponyfill handles legacy and modern browsers properly.

If you're still having issues, consider creating a demo and I'll take a look. Closing this issue as resolved for now, but I'm happy to reopen if needed.