Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Oct 21, 2024
1 parent 34ae654 commit 07f8d62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/mui-material/src/styles/createPalette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,16 @@ export const dark = getDark();

function addLightOrDark(
intent: PaletteColor,
direction: PaletteMode,
direction: 'light' | 'dark',
shade: number | string,
tonalOffset: PaletteTonalOffset,
) {
const tonalOffsetLight = typeof tonalOffset === 'number' ? tonalOffset : tonalOffset.light;
const tonalOffsetDark = typeof tonalOffset === 'number' ? tonalOffset * 1.5 : tonalOffset.dark;

if (!intent[direction]) {
if (intent.hasOwnProperty(shade as keyof typeof intent)) {
intent[direction] = intent[shade as keyof typeof intent];
if (intent.hasOwnProperty(shade)) {
intent[direction] = intent[shade as keyof typeof intent] as string;
} else if (direction === 'light') {
intent.light = lighten(intent.main, tonalOffsetLight);
} else if (direction === 'dark') {
Expand Down

0 comments on commit 07f8d62

Please sign in to comment.