Skip to content

pantoken-root / renderers/mui/src / toMuiTheme

फंक्शन: toMuiTheme() ​

toMuiTheme(tokens, mode?): PantokenThemeOptions

प्रयोगात्मक

टोकन IR से MUI थीम विकल्प बनाएँ।

पैरामीटर ​

tokens ​

केवल-पढ़ने Token[]

IR (उदा. @pantoken/tokens से).

mode? ​

Mode = "light"

कौन सा रंग मोड हल करना है (डिफ़ॉल्ट "light").

वापसी ​

PantokenThemeOptions

MUI के createTheme के लिए विकल्प तैयार।

उदाहरण ​

प्रति-ब्रांड, प्रति-मोड थीम

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

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