Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples don't work #33636

Closed
RowanDZ opened this issue May 16, 2024 · 2 comments
Closed

Examples don't work #33636

RowanDZ opened this issue May 16, 2024 · 2 comments
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@RowanDZ
Copy link

RowanDZ commented May 16, 2024

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet

What specific section or headline is this issue about?

Examples

What information was incorrect, unhelpful, or incomplete?

Examples do not work

What did you expect to see?

Working examples

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

They give:

SyntaxError: Failed to execute 'add' on 'CustomStateSet': The specified value 'checked' must start with '--'.

MDN metadata

Page report details
@RowanDZ RowanDZ added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 16, 2024
@github-actions github-actions bot added the Content:WebAPI Web API docs label May 16, 2024
@minimalsm
Copy link
Contributor

Hey folks :) happy to put up a fix for this.

@hamishwillee
Copy link
Collaborator

Thanks, but the examples do work if you try them on a browser that supports the latest syntax, such as Firefox. This is marked in the page:

image

This will fix itself a bit in the next few weeks as Chrome also supports the new CSS :state() syntax from Chrome 125 - mdn/browser-compat-data#23072

I appreciate this is a bit confusing based on the compatibility data. I've updated the page a bit in #33572 too.

In any case, I propose we do not modify the examples to support the syntax that is no longer allowed by the spec.

Closing this, but if you wanted we'd accept a PR that modifies the examples to check for support of the new state syntax and put a "not supported by this browser warning" when the examples don't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

3 participants