rawBgExprWithState
Commons
stable
Apply a hover or active darkening effect to a raw CSS colour value by wrapping it in a color-mix() expression. Passes through unchanged for the default and disabled roles.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- rawrequisstring
- A raw CSS colour value (hex, rgb, hsl, or CSS custom property expression) to apply the state modification to.
- rolerequisTBgFgRole
- The interaction state role: "default" and "disabled" return the raw value unchanged; "hover" and "active" wrap it in color-mix(in srgb, raw, black N%).
API
Valeur de retour
La valeur retournée par cet util.
- The original colour string for default/disabled roles, or a color-mix() expression with a black blend for hover/active states.
Usage
Exemples
Extraits de code prêts à coller.
Generate hover and active colour expressions