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

Proposal : Spoiler content semantics #9768

Closed
brennanyoung opened this issue Sep 21, 2023 · 5 comments
Closed

Proposal : Spoiler content semantics #9768

brennanyoung opened this issue Sep 21, 2023 · 5 comments

Comments

@brennanyoung
Copy link

I notice that many discussion fora (especially for games or fiction) include a "spoiler" feature.

Typically, the spoiler content is presented as black text on black background. I suppose there are cases where a color other than black is used, but I have not seen them. Sometimes there is a small label ("spoiler") to indicate that the content is deliberately hidden, and may only be exposed when clicked.

The idiom exists to prevent "spoilers" from giving the game away to those that prefer to find out for themselves. Spoiler content may appear "anywhere", but is especially common in online discussions.

Problems with the existing solutions:

  • Non-standard implementations differ from site to site
  • Does not work well or consistently with assistive technology
  • Relies on visual presentation to convey meaning - it is predicated upon (and privileges) sighted users.
  • Spoiler content is rarely an operable "form element", and yet you have to click it to see it.
  • Assistive tech can often read the spoiler text, because the dev forgot to use aria-hidden="true"

Prior Art

<summary> and <details> might have been viable for this semantic, except that there is no way to style the appearance of the 'non-expanded' view - and therefore no way to write CSS for the "black on black" text.

Perhaps if there was a way to style <details> in the closed state, we can go home early.

@annevk
Copy link
Member

annevk commented Sep 21, 2023

Why can't you style details based on the presence of the open attribute?

@brennanyoung
Copy link
Author

AFAICT you simply can't. The user agents implement it as a closed shadow DOM, so there's no way to get inside.

@annevk
Copy link
Member

annevk commented Sep 21, 2023

Oh right, we have some existing issues on that. We should just solve that problem and not add something new, in my opinion.

@brennanyoung
Copy link
Author

Agree. I'm happy to close this if we can link it to any tickets on those issues.

@annevk
Copy link
Member

annevk commented Sep 21, 2023

#8770.

@annevk annevk closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants