- fix mutation error
This commit is contained in:
parent
6d0727c67c
commit
afc49aef0f
@ -36,12 +36,14 @@ const generateTheme = (options: {
|
||||
themes: ThemeInput[];
|
||||
generateColorShades?: boolean | ShadesOptions;
|
||||
}) => {
|
||||
let themes = options.themes;
|
||||
|
||||
if (
|
||||
options.generateColorShades !== undefined &&
|
||||
options.generateColorShades !== false
|
||||
) {
|
||||
options.themes = options.themes.map((theme) => {
|
||||
theme.colors = {
|
||||
themes = themes.map((theme) => {
|
||||
const updatedColors = {
|
||||
...generateShades(
|
||||
theme.colors,
|
||||
typeof options.generateColorShades !== "boolean"
|
||||
@ -51,16 +53,16 @@ const generateTheme = (options: {
|
||||
...theme.colors,
|
||||
};
|
||||
|
||||
return theme;
|
||||
return { ...theme, colors: updatedColors };
|
||||
});
|
||||
}
|
||||
|
||||
const themeRoot = generateThemeRoot({
|
||||
properties: { ...options.themes[0].colors },
|
||||
properties: { ...themes[0].colors },
|
||||
});
|
||||
|
||||
if (options.themes.length > 1) {
|
||||
const themeOverrides = options.themes
|
||||
if (themes.length > 1) {
|
||||
const themeOverrides = themes
|
||||
.slice(1)
|
||||
.map((theme) => {
|
||||
const overrideClass = generateThemeOverrideClass({
|
||||
|
Loading…
x
Reference in New Issue
Block a user