Skip to content

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

Function: customColorCss() ​

customColorCss(hex, options?): string

Beta

Generate the [data-pantoken-color="custom"] rule for a brand hex: it declares the derived --instui-primitive-color-custom-custom* steps and remaps the brand primitives onto them, exactly like the shipped scales.

Parameters ​

hex ​

string

A #rgb/#rrggbb brand color.

options? ​

CustomColorCssOptions = {}

CustomColorCssOptions.

Returns ​

string

The CSS rule.

Throws ​

TypeError when hex isn't a valid hex color.