w3c / w3c/csswg-drafts

[selectors-4] :target-within prose refers to ... itself?

Open
#3,938 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Closed Accepted as Editorial Commenter Response Pending selectors-4
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

The entire definition of :target-within reads today:

The :target-within pseudo-class applies to elements for which the :target pseudo class applies as well as to an element whose descendant in the flat tree (including non-element nodes, such as text nodes) matches the conditions for matching :target-within.

This feels confusingly recursive to parse as the definition is self-referential. Could we re-phrase this as something like

The :target-within pseudo-class applies elements which themselves match, or contain a descendant in the flat tree (including non-element nodes, such as text nodes) which matches, the conditions required to match :target.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the csswg-drafts sources for the exact :target-within definition and read the nearby :target wording for context. Revise the prose so it is not self-referential while preserving the flat-tree and descendant details, then verify the generated specification renders the clarified definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.