mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
fix(theme): add default value for custom theme properties (#5195)
* fix(theme): add default value for custom theme properties * chore(changeset): add issue number --------- Co-authored-by: աӄա <wingkwong.code@gmail.com>
This commit is contained in:
parent
31476000d0
commit
dd60608886
5
.changeset/honest-keys-swim.md
Normal file
5
.changeset/honest-keys-swim.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@heroui/theme": patch
|
||||
---
|
||||
|
||||
add default value for custom theme properties (#5194)
|
||||
@ -277,15 +277,15 @@ export const heroui = (config: HeroUIPluginConfig = {}): ReturnType<typeof plugi
|
||||
Object.entries(otherThemes).forEach(([themeName, {extend, colors, layout}]) => {
|
||||
const baseTheme = extend && isBaseTheme(extend) ? extend : defaultExtendTheme;
|
||||
|
||||
if (colors && typeof colors === "object") {
|
||||
otherThemes[themeName].colors = deepMerge(semanticColors[baseTheme], colors);
|
||||
}
|
||||
if (layout && typeof layout === "object") {
|
||||
otherThemes[themeName].layout = deepMerge(
|
||||
extend ? baseLayouts[extend] : defaultLayoutObj,
|
||||
layout,
|
||||
);
|
||||
}
|
||||
const baseColors = semanticColors[baseTheme];
|
||||
|
||||
otherThemes[themeName].colors =
|
||||
colors && typeof colors === "object" ? deepMerge(baseColors, colors) : baseColors;
|
||||
|
||||
const baseLayout = extend ? baseLayouts[extend] : defaultLayoutObj;
|
||||
|
||||
otherThemes[themeName].layout =
|
||||
layout && typeof layout === "object" ? deepMerge(baseLayout, layout) : baseLayout;
|
||||
});
|
||||
|
||||
const light: ConfigTheme = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user