Skip to content

pantoken-root / platforms/email/src / emailTokens

函式: emailTokens() ​

emailTokens(mode?): Record<string, string>

實驗性

選擇某個模式的 token 對照表(預設 "light")。

參數 ​

mode? ​

Mode = "light"

回傳 ​

Record<string, string>

範例 ​

將 token 內嵌到電子郵件儲存格中(淺色模式)

ts
import { emailTokens } from "@pantoken/email";

const t = emailTokens();
const html = `<td style="background:${t.colorBackgroundBrand};color:${t.colorTextOnColor}">Hi</td>`;

深色模式

ts
import { emailTokens } from "@pantoken/email";

const t = emailTokens("dark");