Variable: CSS_PROPERTY_NAME
ts
const CSS_PROPERTY_NAME: Regex<"(?<name>(?<custom>--)?[a-zA-Z_\\u0080-\\uFFFF][\\w\\-\\u0080-\\uFFFF]*)", {
names: {
custom?: string;
name: string;
};
}>;Defined in: packages/regex/src/tiers/css-spec.ts:156
CSS property name from W3C formal grammar. Standard CSS property name or custom property (variable).
Example
ts
CSS_PROPERTY_NAME.exec("background-color")?.groups?.name // "background-color"
CSS_PROPERTY_NAME.exec("--my-var")?.groups?.name // "--my-var"
const isCustomProp = !!CSS_PROPERTY_NAME.exec(input)?.groups?.custom;