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

Custom color palettes unsupported #17

Open
lgladdy opened this issue Mar 8, 2021 · 2 comments
Open

Custom color palettes unsupported #17

lgladdy opened this issue Mar 8, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@lgladdy
Copy link

lgladdy commented Mar 8, 2021

Tailwinds supports custom color palettes: https://tailwindcss.com/docs/customizing-colors#custom-colors

At the moment, this plugin has very weird behaviour with this kind of configuration as it's looking for numbered shades as per a default configuration.

I've quickly patched this on a fork so we can continue working with it (lgladdy@74fb5c5) but I'm not sure of the repercussions of removing isNaN, so didn't want to submit it as a PR without discussion.

If you follow the custom configuration example on tailwind's docs, you'll end up with duplicate key names because of the isNaN check, and the majority of your colours will be excluded. Removing this isNaN check (and enabling shades) forces the correct generation with my patch, but this is probably not the best way of moving forward.

Potentially, the best solution would be to check for NaN keys which still have a value, and auto-enable shades in that case, and remove the isNaN check?

I'm happy to write this code and submit a PR, but would value some input from the core dev(s) on if this seems sensible?

@lgladdy
Copy link
Author

lgladdy commented Mar 10, 2021

I've made another revision on my fork too to deal with "default" being stripped out by tailwind. We'll need to include that too. (lgladdy@e6ed99c)

@Log1x Log1x added the enhancement New feature or request label Mar 10, 2021
@Log1x Log1x self-assigned this Mar 10, 2021
@Log1x
Copy link
Member

Log1x commented Mar 11, 2021

Feel free to start up a PR for this.

This was referenced Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants