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

Unable to use groups in variants #18

Open
BenJeau opened this issue Oct 23, 2021 · 1 comment
Open

Unable to use groups in variants #18

BenJeau opened this issue Oct 23, 2021 · 1 comment

Comments

@BenJeau
Copy link

BenJeau commented Oct 23, 2021

Love this package, it will save me a lot in my multiple color themed app, but I just have one issue. I'm trying to set a group to the theme and pass it to the variants in the config but I am getting the following error:

Internal server error: Your config mentions the "schemes" variant, but "schemes" doesn't
appear to be a variant. Did you forget or misconfigure a plugin that supplies that variant?

Here is my config (I this is a simple reproduction):

const { themeVariants } = require("tailwindcss-theme-variants");

module.exports = {
  purge: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  darkMode: false,
  theme: {},
  variants: {
    backgroundColor: ["schemes"],
  },
  plugins: [
    themeVariants({
      group: "schemes",
      themes: {
        green: {
          selector: ".themed-green",
          semantics: {
            colors: {
              600: "green.800",
            },
          },
        },
        blue: {
          selector: ".themed-blue",
          semantics: {
            colors: {
              600: "blue.600",
            },
          },
        },
        yellow: {
          selector: ".themed-yellow",
          semantics: {
            colors: {
              600: "yellow.600",
            },
          },
        },
        purple: {
          selector: ".themed-purple",
          semantics: {
            colors: {
              600: "purple.600",
            },
          },
        },
      },
    }),
  ],
};

Would you know how to fix this issue? (I'm using React if that has any impact)

@BenJeau
Copy link
Author

BenJeau commented Oct 23, 2021

mhhh, it seems like it works without specifying the variants

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