Features/Designer

Advanced states

Style hover, focus, active, child, pseudo element and custom selector states for any element or class.

Each element or class can have style instances for states. Pick a state like Hover or Focus, optionally a subject such as a child tag or child class, and edit styles as usual; they apply only in that state. For anything not in the list you can type a custom state like :nth-child(3) or a descendant selector.

How it works

  • Built in states: Default, Hover, Active (.dh-active); Forms: Placeholder, Focus, Focus Within, Disabled, Error (.dh-error); Children: First child, Last child, First of type, Last of type, Nth child odd, Nth child even; Advanced: After, Before, Pressed, Empty.
  • Subjects (target a descendant): div, a, p, span, img, video, h1 to h6, ol, ul, li, i, form, input, select, textarea, label, iframe, * (all), plus any class or id found inside the element ('Children with class', 'Children with ID').
  • State and subject combine, for example ':hover h3'.
  • Custom tab: free text state; values not starting with :, ., [, # are treated as a descendant; states cannot start with a number.
  • Stored as a state key per breakpoint; server keeps up to 40 characters per state.
  • Compiled as identifier + state, for example .card:hover h3 { }.
  • ::before and ::after show a Content field.
  • Shortcuts: CMD/CTRL + H edit hover state, CMD/CTRL + G back to default.
  • Existing instances are listed and can be removed.

When to use it

  • Change a card's title color when the card is hovered
  • Style form placeholders and focus rings
  • Add a decorative ::before line

Limitations

  • State names over 40 characters are dropped on save
  • Custom states are not validated beyond a leading number check

Availability

  • Works in Designer.
  • Included in every plan.

How to use it.

  1. Select an element or class
  2. Click + Instance in the selector
  3. Pick a State and optional Subject, or use the Custom tab
  4. Click Create and edit styles

Questions.

Can I style a child on parent hover?

What is the Active state?

Related features.

No card needed

Build it today.Pay when it goes live.

Every feature is unmetered while you build. Checkout opens the first time you publish.