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

tailwind presets' custom theme was treated as unknown classes #26

Open
zcqno1 opened this issue Mar 9, 2021 · 0 comments
Open

tailwind presets' custom theme was treated as unknown classes #26

zcqno1 opened this issue Mar 9, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@zcqno1
Copy link

zcqno1 commented Mar 9, 2021

Describe the bug
I make my custom theme as a tailwind preset and require it in the tailwind.config.js. It results that the custom theme(here is bg-primary ) was treated as unknown class and was placed at the start by default.

image

config like:

// preset.js
module.exports = {
  theme: {
    colors: {
      primary: '#206EF7'
    }
  }
}

// tailwind.config.js
module.exports = {
  presets: [require('./preset.js')],
  ...
}

While just placing the custom theme in tailwind.config.js, it works as expected.

image

config like:

// tailwind.config.js
module.exports = {
  theme: {
    colors: {
      primary: '#206EF7'
    }
  }
  ...
}

Expected behavior
The custom theme's classes should be recognized and sorted as known classes.

Versions:

  • prettier-plugin-tailwind version: 2.2.10
  • Operating system: wsl
  • NPM/Yarn version: yarn v1.x
@zcqno1 zcqno1 added the bug Something isn't working label Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants