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* 步驟,並將品牌 primitive 精確地重新對映到這些步驟上,正如出貨的色階一樣 。

參數 ​

hex ​

string

一個 #rgb/#rrggbb 品牌顏色。

options? ​

CustomColorCssOptions = {}

CustomColorCssOptions.

回傳 ​

string

CSS 規則字串。

可能拋出 ​

當 hex 不是有效的十六進位顏色時拋出 TypeError。