Skip to content

pantoken-root / renderers/mui/src / toMuiTheme

Mahi: toMuiTheme() ​

toMuiTheme(tokens, mode?): PantokenThemeOptions

Whakamātautau

Hangaia ngā kōwhiringa kaupapa MUI mai i tētahi IR token.

Ngā Tawhā ​

tokens ​

panui-anake Token[]

Te IR (hei tauira, nō @pantoken/tokens).

mode? ​

Mode = "light"

Ko tēhea aratau tae hei whakatau (taunoa "light").

Whakahokia ​

PantokenThemeOptions

Ngā kōwhiringa kua rite mō te createTheme o MUI.

Tauira ​

Kaupapa mō ia waitohu, mō ia aratau

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

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