Skip to content

pantoken-root / plugins/pantoken/custom-theme-colors/src / customColorCss

函数: customColorCss() ​

customColorCss(hex, options?): string

Beta

为品牌十六进制颜色生成 [data-pantoken-color="custom"] 规则:它声明派生的 --instui-primitive-color-custom-custom* 步骤,并将品牌原语精确地重新映射到这些步骤上,正如出厂提供的色阶一样 。

参数 ​

hex ​

string

一种 #rgb/#rrggbb 品牌颜色。

options? ​

CustomColorCssOptions = {}

CustomColorCssOptions.

返回值 ​

string

CSS 规则字符串。

抛出 ​

当 hex 不是有效的十六进制颜色时抛出 TypeError。