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