You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a file of css variables for approved common colors sitting on a cdn. We are a mix of Vue, Angular, and Stencil in our shop, depending on the app, so it is good to have a single source of truth for these colors across all frameworks.
For our Vue apps, I've been looking at Vuetify themes and they've been working great. To keep all of the css color variables on one system, I'd like to be able to pull in that css file and use those same variables. What I have right now is something like:
Which cuts down on repetition and makes it easy to update colors. I'd like to stop duplicating what is in our cdn though. I can't really use an @use or @import to import a css file from a url here. Since it is just javascript, I could use use fetch and do something like this:
Then parse data and grab the variables and their values and push them into the colors object. That seems a pain though. It seems like there ought to be a better way. The only other thing I could think of was an npm script that did something similar on build, but then I'd be stuck with outdated colors when we have to update them. But that's also a problem with the current system.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We have a file of css variables for approved common colors sitting on a cdn. We are a mix of Vue, Angular, and Stencil in our shop, depending on the app, so it is good to have a single source of truth for these colors across all frameworks.
For our Vue apps, I've been looking at Vuetify themes and they've been working great. To keep all of the css color variables on one system, I'd like to be able to pull in that css file and use those same variables. What I have right now is something like:
Which cuts down on repetition and makes it easy to update colors. I'd like to stop duplicating what is in our cdn though. I can't really use an
@use
or@import
to import a css file from a url here. Since it is just javascript, I could use use fetch and do something like this:Then parse data and grab the variables and their values and push them into the colors object. That seems a pain though. It seems like there ought to be a better way. The only other thing I could think of was an npm script that did something similar on build, but then I'd be stuck with outdated colors when we have to update them. But that's also a problem with the current system.
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions