pantoken / renderers/mui/src / toMuiTheme
Függvény: toMuiTheme()
toMuiTheme(
tokens,mode?):PantokenThemeOptions
Kísérleti
MUI téma beállítások felépítése token IR-ből.
Paraméterek
tokens
readonly Token[]
Az IR (pl. @pantoken/tokens-ből).
mode?
Mode = "light"
Melyik szín mód oldja fel (alapértelmezett "light").
Visszatérés
Beállítások a MUI createTheme-hez.
Példa
Márkánkénti, módonkénti téma
ts
import { createTheme } from "@mui/material/styles";
import { toMuiTheme } from "@pantoken/mui";
import { byTheme } from "@pantoken/tokens";
const darkCanvas = createTheme(toMuiTheme(byTheme("canvas"), "dark"));