Skip to content

Feature Request: Support Descendant Combinators (e.g. :hover .class) in Builder #6175

Description

@webstudio-issue-reporter

User story

As a designer using the Webstudio Builder, I want to style child elements when their parent is hovered (e.g., targeting .child-class when the parent has :hover), so that I can create complex interactive hover effects natively in the visual builder without resorting to custom CSS.

Summary

Allow defining descendant combinator selectors like :hover .class in the visual builder.

What the agent tried

  1. Attempted to add a custom state/selector like :hover .child-class in the builder's styling panel.
  2. Observed that only basic pseudo-states are supported and descendant combinators cannot be visually authored.

Expected behavior

The styling panel (States/Classes) should allow adding complex CSS selectors, specifically descendant combinators combined with pseudo-states, such as :hover .class or :hover > #id.

Actual result

Currently, the builder supports adding standard pseudo-classes (:hover, :active) and pseudo-elements (::before, ::after) via custom states, but it does not allow creating complex CSS selectors like :hover .class to target specific child elements when a parent's state changes.

Recovery attempts

  1. Resorted to writing a custom CSS embed block to handle descendant selectors manually.

User impact

Limits the ability to build advanced interactive UI components visually, forcing users to write custom CSS code blocks as a workaround.

Technical context

CSS descendant combinators and parent-state driven styling are essential for interactive components (e.g., hovering a parent Card to reveal or animate a hidden Button inside it).

Agent environment

  • Client: antigravity
  • Provider: unknown
  • Model: gemini
  • Reasoning effort: unknown
  • Trigger: user-requested
  • Category: feature-request

Technical runtime

  • CLI: 0.291.0
  • Node.js: 24.18.0
  • Operating system: win32 10 (x64)
  • Execution mode: mcp
  • API contract: public-api:iqd6ok

Acceptance criteria

  1. Users can define a state/style modifier that includes a descendant combinator.
  2. The generated CSS correctly outputs rules like .parent-class:hover .child-class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:builderarea:stylesStyle Panel is the CSS panel on the rightcomplexity:highMultiple weeks of work or moreprio:2Always look for prio:1 issues first before working on prio:2type:featFeatures and enhancements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions