Skip to content

Commit

Permalink
fix: Add missing getColorSchemeSelector method
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Sep 3, 2024
1 parent d69ce8b commit 77a6e4a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
CssVarsTheme,
ThemeOptions,
experimental_extendTheme as extendTheme,
} from "@mui/material/styles"
Expand All @@ -7,7 +8,7 @@ import { colorSchemas } from "./colorSchemes"
import { components } from "./components"
import { typography } from "./typography"

function theme(type: "light" | "dark"): ThemeOptions {
function theme(type: "light" | "dark"): ThemeOptions & Partial<CssVarsTheme> {
const palette = createPalette(colorSchemas[type].palette)

return {
Expand All @@ -18,9 +19,10 @@ function theme(type: "light" | "dark"): ThemeOptions {
borderRadius: 6,
},
components: components(colorSchemas[type].palette as Palette),
} as ThemeOptions),
getColorSchemeSelector: (type: string) => colorSchemas[type],
} as ThemeOptions & Partial<CssVarsTheme>),
palette,
}
} as ThemeOptions & Partial<CssVarsTheme>
}

const light = theme("light")
Expand Down

0 comments on commit 77a6e4a

Please sign in to comment.