Skip to content

pantoken / renderers/mui/src / toMuiTheme

Swyddogaeth: toMuiTheme()

toMuiTheme(tokens, mode?): PantokenThemeOptions

Arbrofol

Adeiladu opsiynau thema MUI o IR tocyn.

Paramedrau

tokens

darllen-yn-unig Token[]

Yr IR (er enghraifft o @pantoken/tokens).

mode?

Mode = "light"

Pa fodd lliw i'w ddatrys (diofyn "light").

Yn dychwelyd

PantokenThemeOptions

Opsiynau wedi'u paratoi ar gyfer createTheme MUI.

Enghraifft

Thema fesul frand, fesul modd

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

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