Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!theme.palette || !theme.palette.accent) {
newPalette.accent = newPalette.themePrimary;
}
// mix in custom overrides with good slots first, since custom overrides might be used in fixing deprecated slots
let newSemanticColors = {
..._makeSemanticColorsFromPalette(newPalette, !!theme.isInverted, depComments),
...theme.semanticColors
};
let defaultFontStyles: IFontStyles = { ...DefaultFontStyles };
if (theme.defaultFontStyle) {
for (const fontStyle of Object.keys(defaultFontStyles)) {
defaultFontStyles[fontStyle] = merge({}, defaultFontStyles[fontStyle], theme.defaultFontStyle);
}
}
if (theme.fonts) {
for (const fontStyle of Object.keys(theme.fonts)) {
defaultFontStyles[fontStyle] = merge({}, defaultFontStyles[fontStyle], theme.fonts[fontStyle]);
}
}
return {
palette: newPalette,
fonts: {
...defaultFontStyles
},
semanticColors: newSemanticColors,
isInverted: !!theme.isInverted,
let newSemanticColors = {
..._makeSemanticColorsFromPalette(newPalette, !!theme.isInverted, depComments),
...theme.semanticColors
};
let defaultFontStyles: IFontStyles = { ...DefaultFontStyles };
if (theme.defaultFontStyle) {
for (const fontStyle of Object.keys(defaultFontStyles)) {
defaultFontStyles[fontStyle] = merge({}, defaultFontStyles[fontStyle], theme.defaultFontStyle);
}
}
if (theme.fonts) {
for (const fontStyle of Object.keys(theme.fonts)) {
defaultFontStyles[fontStyle] = merge({}, defaultFontStyles[fontStyle], theme.fonts[fontStyle]);
}
}
return {
palette: newPalette,
fonts: {
...defaultFontStyles
},
semanticColors: newSemanticColors,
isInverted: !!theme.isInverted,
disableGlobalClassNames: !!theme.disableGlobalClassNames,
spacing: {
...DefaultSpacing,
...theme.spacing
},
effects: {