Skip to content

Commit

Permalink
fix(templates): prevent overriding existing colors
Browse files Browse the repository at this point in the history
Resolves #3426
  • Loading branch information
benjamincanac committed Mar 3, 2025
1 parent 145fce1 commit ccbd89c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function getTemplates(options: ModuleOptions, uiConfig: Record<string, an
--color-old-neutral-800: ${colors.neutral[800]};
--color-old-neutral-900: ${colors.neutral[900]};
--color-old-neutral-950: ${colors.neutral[950]};
${[...(options.theme?.colors || []), 'neutral'].map(color => [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].map(shade => `--color-${color}-${shade}: var(--ui-color-${color}-${shade});`).join('\n\t')).join('\n\t')}
${[...(options.theme?.colors || []).filter(color => !colors[color as keyof typeof colors]), 'neutral'].map(color => [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].map(shade => `--color-${color}-${shade}: var(--ui-color-${color}-${shade});`).join('\n\t')).join('\n\t')}
}
`
})
Expand Down

0 comments on commit ccbd89c

Please sign in to comment.