Skip to content

pantoken / renderers/mui/src / toMuiTheme

Fall: toMuiTheme()

toMuiTheme(tokens, mode?): PantokenThemeOptions

Tilrauna

Smíða MUI þema-valkosti úr token IR.

Færibreytur

tokens

readonly Token[]

IR-ið (t.d. frá @pantoken/tokens).

mode?

Mode = "light"

Hvaða litastilling á að leysa (sjálfgefið "light").

Skilar

PantokenThemeOptions

Valkostir tilbúnir fyrir MUI's createTheme.

Dæmi

Þema fyrir hvert vörumerki og hvert ham

ts
import { createTheme } from "@mui/material/styles";
import { toMuiTheme } from "@pantoken/mui";
import { byTheme } from "@pantoken/tokens";

const darkCanvas = createTheme(toMuiTheme(byTheme("canvas"), "dark"));