[csswg-drafts] @element query (#12800)

bigandy has just created a new issue for https://github.com/w3c/csswg-drafts:

== @element query ==
@container style() queries do not have access to the variables unless it is set on the parent (container). 

Inline if() style queries do have access to the variable which is useful. I would really appreciate the ability to query against the variable in a block-like manor for example:


.block {
 --feature-enabled: true;
 --block-index: sibling-index();


  @element (--feature-enabled: true) {
        /* styles block for feature-enabled: true */
  }

  @element (--block-index > 5) {
        /* styles block for fifth item and more */
  }
}



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12800 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 15 September 2025 10:11:56 UTC