How can we store the css
styles into a constant and use them?
#6603
-
I've updated few styles and wrote it in Now I would like to store them in a variable and use it like how it is being used in Combobox component like below
Do I need to take any extra steps to be able to use Any help would be appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This is in the component which you have copied? is it already built? or is it now "source" in your project?
a plain string in the classname won't match any classnames declared in the CSS module, all of them must reference the classname on the CSS module object. If it's part of your source, you'll have to figure out how to use the CSS in the way that makes sense for your project. |
Beta Was this translation helpful? Give feedback.
Depends on what bundler you're using.
https://stackoverflow.com/questions/64688862/how-to-load-css-files-with-webpack
https://parceljs.org/languages/css/
https://vitejs.dev/guide/features#css-modules
Though if you've copied the CSS, then I suspect you're going to have even more problems because there are a number of plugins we run over the CSS and you won't have those necessarily.
https://github.com/adobe/react-spectrum/blob/main/postcss.config.js
If you can, you may just want to use the component as is, wait to update until RAC has the support you need, or back this conversation up to what changed which prompted the need for this.
We may have other suggestions if we back up to the root o…