-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
How to use css variable from CDN file in angular 6? #46
Comments
Hi @sga-girdhari, The errors you are receiving indicate that the CDN server you are using is not CORS-enabled. Specifically, the CDN server is not setting the appropriate response headers that allow the ponyfill to request If possible, switch to a CDN that is already CORS-enabled. If this is not possible, consider hosting the CSS file locally (on the same server as your app). Either one of these options will (presumably) also resolve the undefined variable warnings you are seeing in the console as well. |
Hi @jhildenbiddle , Thanks for replying so quickly, I am doing it locally for now, but will try to enable CORS on CDN server. Thanks. |
@sga-girdhari @jhildenbiddle Hi, I'm planning to implement this ponyfill to angular 7 project. but |
Hi @sheikalthaf, Thanks. |
@sga-girdhari Thanks. I have placed the cssVars({
rootElement: element,
onlyLegacy: false,
onlyVars: true,
variables: theme.properties,
watch: true,
onComplete: (a, b, variables) => {}
}); @jhildenbiddle if i enable watch then styles get applied but IE browser hangs for a while and then restored. |
Best to create a new issue since this one is closed. Before you do that, understand that I'm not sure how much help I can provide without seeing the CSS involved. Consider creating a demo project that is configured like yours so others can review and make suggestions. I have found codesandbox.io and stackblitz.com useful for such tasks. |
Hi @jhildenbiddle ,
I am trying to use this library in one of my angular 6 project, which is using CSS variable from a file coming from CDN (due to theme implementation, I can switch theme/files dynamically).
But I am getting CORS issue on IE, and warning on chrome/other browsers regarding undefined variable (I will set onlyLegacy to true though).
Can you please help me, in loading file from CDN on angular 6 project.
Please see attached snapshot.
Thanks.
The text was updated successfully, but these errors were encountered: