-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
[bug] Tailwind Colors transformPalette not reducing nested values #1339
Comments
Is this a thing that even works in tailwind? Looking at the tailwind docs I don't see any mention of n-level nesting for color groups. Simplified, the example provided looks like: module.exports = {
theme: {
colors: {
'tahiti': {
100: '#cffafe',
},
},
},
} But you want support for: module.exports = {
theme: {
colors: {
'tahiti': {
'sub-color': {
100: '#cffafe',
}
},
},
},
} Looking at the DefinitelyTyped/tailwindcss repo those types don't allow for this use case either. A export type TailwindColorValue = string | TailwindColorGroup | TailwindColorFunction; And a export interface TailwindColorGroup {
readonly [key: string]: string;
} Am I missing something? Does this work for you? Regardless, since this isn't documented I'm going to mark this as a feature request. That said, assuming it works and there can be some assurance that this hidden feature is not going to change, I don't mind adding support for it. |
Tailwind does run tests for deeply nested color objects so it should be allowed. I've been using this nesting in Tailwind for some time without any issues. Relevant Tailwind PR |
thank you for the references. i think the next step for us is to add recursion to the color value reducer: bud/sources/@roots/sage/src/theme/tailwind.adapter.ts Lines 61 to 69 in 5164bc9
afterward we should submit a PR on the typings. |
Agreement
Expected Behavior
TransformPalette should output theme.json ready colors for nested colors
Color array like in theme.json ready format like:
Actual Behavior
Nested colors does gets output with incorrect themeJSON format:
Steps To Reproduce
Create nested Tailwind Colors
Set up bud config for colors (config below) and build
version
5.7.7
What package manager are you using?
yarn classic
version
1.22.18
Are you using pnpm?
Logs
No response
Configuration
Relevant .budfiles
budfiles.zip
The text was updated successfully, but these errors were encountered: