Skip to content

pantoken / 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"));