Change styles when element states change.
In Sfumato, you can make any utility class conditional by prefixing it with a variant that specifies the state you want to target.
For example, to set the background color to sky-500 when an element is hovered, use the class hover:bg-sky-500:
Try interacting with the anchor button above to see hover, focus, and active states.
Sfumato offers a wide range of variants to cover nearly any scenario, including:
You can even combine multiple variants to target highly specific situations—for instance, changing the background color on hover, but only when it is also not focused:
Following are state pseudo-class variants:
Use the not-{pseudo-class} variant to set styles when a state is not true, like "not hover".