Skip to content
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

Add an index.css file including all colours alongside index.js #38

Open
jacob-roling opened this issue Dec 4, 2023 · 0 comments
Open

Comments

@jacob-roling
Copy link

I would like to use postcss-jit-props to extract only the variables I need from each colour stylesheet. It would allow me to do the following:

module.exports = {
  plugins: {
    "postcss-jit-props": {
      files: [
        path.resolve(__dirname, "node_modules/@radix-ui/colors/index.css"),
      ],
    },
  },
};

Now I should be able to use any radix colour anywhere in my css and postcss will import only that variable from the index.css file. However it requires that all available CSS variables be stored in a single file to read from. There is no option for this other than for me to combine all the available colour CSS files into a single file and use that.

Instead, I propose since there is already an index.js file exporting all the colours, why not include an index.css file that includes every colour variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant