Skip to content

Conversation

@SURYAS1306
Copy link
Contributor

@SURYAS1306 SURYAS1306 commented Jan 22, 2026

###Description

This PR corrects the “Allowable properties” section for the ::highlight pseudo-element.
It removes vendor-prefixed properties and updates the list to use the standard stroke-color, fill-color, and stroke-width properties.

###Motivation

The MDN page currently lists -webkit-text-* properties as allowable, which does not match the CSS specification.
This change aligns the documentation with the spec and prevents developers from relying on unsupported properties.

###Related issues and pull requests

Fixes #42863

@SURYAS1306 SURYAS1306 requested a review from a team as a code owner January 22, 2026 12:11
@SURYAS1306 SURYAS1306 requested review from estelle and removed request for a team January 22, 2026 12:11
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed labels Jan 22, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

Preview URLs (1 page)

Flaws (2)

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/CSS/Reference/Selectors/::highlight
Title: ::highlight()
Flaw count: 2

  • macros:
    • Macro cssxref produces link /en-US/docs/Web/CSS/stroke-color which doesn't resolve
    • Macro cssxref produces link /en-US/docs/Web/CSS/fill-color which doesn't resolve

(comment last updated: 2026-02-10 20:46:51)

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

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

made a suggestion.
if the -webkit- aren't in the spec, we don't need to mention them

Comment on lines 23 to 25
- {{CSSxRef("stroke")}}, {{CSSxRef("fill")}}, and {{CSSxRef("stroke-width")}}

Vendor-prefixed properties such as {{CSSxRef("-webkit-text-stroke-color")}} or {{CSSxRef("-webkit-text-fill-color")}} do not apply to highlight pseudo-elements.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- {{CSSxRef("stroke")}}, {{CSSxRef("fill")}}, and {{CSSxRef("stroke-width")}}
Vendor-prefixed properties such as {{CSSxRef("-webkit-text-stroke-color")}} or {{CSSxRef("-webkit-text-fill-color")}} do not apply to highlight pseudo-elements.
- {{CSSxRef("stroke-color")}}, {{CSSxRef("fill-color")}}, and {{CSSxRef("stroke-width")}}
- Custom properties ({{cssxref("--*"))}}

@SURYAS1306
Copy link
Contributor Author

Hi @estelle , I’ve removed the vendor-prefixed properties and kept only the spec-defined allowable properties. Please let me know if this looks good now. Thanks!

@estelle
Copy link
Member

estelle commented Jan 26, 2026

Hi @estelle , I’ve removed the vendor-prefixed properties and kept only the spec-defined allowable properties. Please let me know if this looks good now. Thanks!

I haven't tested them since they props only apply to svg, but the spec reads stroke-color and the pr has stroke. Also, the spec lists custom properties as supported props.

@flying-sheep
Copy link

@SURYAS1306 can you make these updates or should someone else fix this?

@SURYAS1306 SURYAS1306 requested a review from a team as a code owner February 10, 2026 20:45
@SURYAS1306 SURYAS1306 requested review from pepelsbey and removed request for a team February 10, 2026 20:45
@SURYAS1306
Copy link
Contributor Author

SURYAS1306 commented Feb 10, 2026

Hi @estelle,
I've updated the properties to stroke-color and fill-color as per the spec, and I also added the line for Custom Properties. Let me know if there's anything else.

@flying-sheep I have applied the updates

@pepelsbey
Copy link
Member

Hey! Thank you for contributing 🙂

Unfortunately, it’s a little complicated:

  • Only Safari supports the stroke-color property (currently not documented on MDN, unfortunately)
  • No browser supports the fill-color property. It only exists in the spec for now.
  • Only the stroke-width property is fine, well-supported, and documented.

So I wonder if we shouldn’t mention the fill-color property at all in this list, as it’s purely theoretical.

@estelle what do you think?

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/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

::highlight() page mentions -webkit-* as allowable property, but spec doesn't mention these

4 participants