[csswg-drafts] [css-pseudo] Pseudo element selector, Behavior Control of Nested Hierarchical/Tree Recursion, Propagation/inheritance of selection (#11441)

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

== [css-pseudo] Pseudo element selector, Behavior Control of Nested Hierarchical/Tree Recursion, Propagation/inheritance of selection ==
I would like to propose the following pseudo selectors, to help in controlling the CSS element selector inheritance/propagation nested recursion that one could try use templates, but one would still run into problems the larger schema of things here, with whats trying to be achieved ideally with what I have been designing. used in combination with apply-style-this-element-only https://github.com/w3c/csswg-drafts/issues/11440 alot

**Proposal**
Implement the following combination of Pseudo Element Selectors that control behaviour of the selector

Think of this as much more advanced Child combinator | > | div > p | Selects every <p> element that are direct children of a <div>

- selector-set:first-nested-sel-set

selects the first selection occurrence, and will not recuse any further.

- selector-set:nth-neasted-sel-set(n < full matching limit or n + 1)

selects the up until the nth matching selector or an exact value match or parameter matched.

- selector-set:until-neasted-sel-set(relative selector)

The most important would be this one, to more accurate control depth of propagation and recursion
[Relative selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors/Selector_structure#relative_selector)

where selector-set = div.className > input:active > span ~ items

i.e
```.css
selector-set = div.className > input:active > span ~ items: until-neasted-sel-set(.items > .menu): apply-style-this-element-only
{
border 0.1em solid #red
}
```




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


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

Received on Sunday, 5 January 2025 08:30:38 UTC