Pseudo Selector Recipes
Pseudo selector recipes provide utility patterns for working with CSS pseudo-classes and pseudo-elements in Etch.
-
::before: Creates a
::beforepseudo-element with an emptycontentproperty. Useful for decorative elements, icons, or overlays. -
::after: Creates an
::afterpseudo-element with an emptycontentproperty. Useful for decorative elements, icons, or overlays. -
::before, ::after: Creates both
::beforeand::afterpseudo-elements with emptycontentproperties in a single selector. Useful when you need to style both pseudo-elements the same way. -
:hover: Creates a
:hoverpseudo-class selector. Useful for interactive states and hover effects. -
:focus-visible: Creates a
:focus-visiblepseudo-class selector. Useful for keyboard navigation focus states that should only appear when using keyboard navigation. -
:hover, :focus-visible: Creates a combined selector for both
:hoverand:focus-visiblestates. Useful when you want the same styling for both hover and keyboard focus states.