Skip to content

pantoken / renderers/mui/src / toMuiTheme

Funkcija: toMuiTheme()

toMuiTheme(tokens, mode?): PantokenThemeOptions

Eksperimentalno

Sestavi možnosti teme MUI iz token IR.

Parametri

tokens

readonly Token[]

IR (npr. iz @pantoken/tokens).

mode?

Mode = "light"

Kateri barvni način razrešiti (privzeto "light").

Vrne

PantokenThemeOptions

Možnosti pripravljene za MUI-jev createTheme.

Primer

Tema za vsako znamko in za vsak način

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

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