This is a little trick to get CSS hover style behavior with inline styles.
The example snippet uses background color and 3 states (default, hover, selected class) but you likely also want to add similar functionality for at least color, border-color.
Demo: https://codepen.io/makakoa/pen/ZEVbQXO
- If you want to use themes it should look something like
"--bg-default": Colors.get("bg")
where Colors knows what to return for current theme. - The default should follow the same pattern to ensure the specificity is lower than other states. (an inline
'background-color'
would have higher specificity) - If adding a rule for border color use
border-color
in the rule andborder-width / style
inline. If you add aborder
entry inline it will preclude these styles.