Skip to content

Conversation

@chrisdavidmills
Copy link
Contributor

Description

Chrome 142 adds support for the :target-before and :target-after pseudo classes. See https://chromestatus.com/feature/5120827674722304.

This PR adds reference docs for the new pseudos, and adds mention and coverage of them in appropriate places.

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner November 25, 2025 08:50
@chrisdavidmills chrisdavidmills requested review from dipikabh and removed request for a team November 25, 2025 08:50
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Nov 25, 2025
@chrisdavidmills chrisdavidmills changed the title Document :target-before and :target-after pseudos Technical review: Document :target-before and :target-after pseudos Nov 25, 2025
@github-actions github-actions bot added the size/l [PR only] 501-1000 LoC changed label Nov 25, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2025

Preview URLs (9 pages)
Flaws (4)

Note! 6 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/CSS/Guides/Overflow/Carousels
Title: Creating CSS carousels
Flaw count: 1

  • unknown:
    • Error parsing /shared-assets/images/diagrams/css/carousels/carousel.svg: No such file or directory (os error 2)

URL: /en-US/docs/Web/CSS/Reference/Properties/scroll-marker-group
Title: scroll-marker-group
Flaw count: 2

  • broken_links:
    • /en-US/docs/Web/CSS/CSS_values_and_units/Value_definition_syntax#single_bar is a redirect
    • /en-US/docs/Web/CSS/CSS_values_and_units/Value_definition_syntax#single_bar is a redirect

URL: /en-US/docs/Web/CSS/Reference/Properties/scroll-target-group
Title: scroll-target-group
Flaw count: 1

  • broken_links:
    • /en-US/docs/Web/CSS/CSS_values_and_units/Value_definition_syntax#single_bar is a redirect
External URLs (2)

URL: /en-US/docs/Web/CSS/Reference/Selectors/:target-after
Title: :target-after


URL: /en-US/docs/Web/CSS/Reference/Selectors/:target-before
Title: :target-before

(comment last updated: 2025-11-25 10:53:57)

@chrisdavidmills chrisdavidmills changed the title Technical review: Document :target-before and :target-after pseudos Editorial review: Document :target-before and :target-after pseudos Nov 25, 2025
@danielsakhapov
Copy link

LGTM

- {{cssxref("::scroll-marker-group")}}
- {{cssxref("::scroll-marker")}}
- {{cssxref(":target-current")}}
- [`:target-before`](/en-US/docs/Web/CSS/Reference/Selectors/:target-before)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use macros in the css docs whenever possible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually do, but at the moment, I'm using raw markdown links until the cssxref macro is fixed. Last time I checked, it was still broken for new links.

}

:target-current {
color: red;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an outline or some other non-color differentiator for those who can't distinguish reds

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, the three different link states (before, current, and after) are distinguished by gray and line-through, red, and black and underlined, so they are not distinguished by color alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs size/l [PR only] 501-1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants