Open lgladdy opened 3 years ago
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. (https://github.com/lgladdy/palette-webpack-plugin/commit/e6ed99c4ed0be70d063fbcbf03e2c2a6a718126d)
Feel free to start up a PR for this.
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 (https://github.com/lgladdy/palette-webpack-plugin/commit/74fb5c59860bcf963373c05743cf7b8e5bd81085) 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?