feat(module): add support for taupe / mauve / mist / olive neutral colors#6081
Conversation
📝 WalkthroughWalkthroughThis pull request expands the neutral color palette used throughout the theme system. Four new color identifiers—taupe, mauve, mist, and olive—are added to the NeutralColor type definition and corresponding runtime color arrays across four files: the theme composable, the theme dropdown component, and two type/plugin files. The changes are consistent and additive, maintaining existing functionality while broadening the set of available neutral colors. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/templates.ts (1)
296-297: Extract duplicatedNeutralColortype to a shared module.The
NeutralColortype is defined identically in bothsrc/templates.ts(line 296) andsrc/unplugin.ts(line 27). Any future additions must be updated in two places with no compile-time guard against divergence. Extract to a single shared source:♻️ Suggested extraction
Create
src/types.ts:+export type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone' | 'taupe' | 'mauve' | 'mist' | 'olive'Then in both
src/templates.tsandsrc/unplugin.ts:+import type { NeutralColor } from './types' -type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone' | 'taupe' | 'mauve' | 'mist' | 'olive'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/templates.ts` around lines 296 - 297, Extract the duplicated NeutralColor union into a single exported type in a new module (e.g., create src/types.ts) and export NeutralColor so both modules can import it; then remove the local NeutralColor definition in src/templates.ts and src/unplugin.ts and update the Color type in each to reference the imported NeutralColor instead of the local symbol, ensuring imports are added (import { NeutralColor } from 'src/types') and no other logic is changed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/unplugin.ts`:
- Around line 27-28: The NeutralColor union is duplicated; extract the
NeutralColor definition into a single shared type and import it where needed,
then update the local Color type to reference that imported NeutralColor instead
of re-declaring it; specifically remove the duplicate NeutralColor in
unplugin.ts and have the Color type (symbol: Color) use the shared NeutralColor
type (symbol: NeutralColor) so both places share the single canonical
definition.
---
Nitpick comments:
In `@src/templates.ts`:
- Around line 296-297: Extract the duplicated NeutralColor union into a single
exported type in a new module (e.g., create src/types.ts) and export
NeutralColor so both modules can import it; then remove the local NeutralColor
definition in src/templates.ts and src/unplugin.ts and update the Color type in
each to reference the imported NeutralColor instead of the local symbol,
ensuring imports are added (import { NeutralColor } from 'src/types') and no
other logic is changed.
commit: |
🔗 Linked issue
❓ Type of change
📚 Description
Following the release of Tailwind CSS
v4.2.0, I have added the new color options to the neutral palette. This change includes:taupe,mauve,mist, andoliveto theneutralColorsconstant inuseTheme.ThemeDropdowncomponent in the playground to support these new options.NeutralColorTypeScript types insrc/templates.tsandsrc/unplugin.ts.📝 Checklist