json-schema-org / json-schema-org/website
🐛 Bug: Heading anchor highlight (:target) cannot be cleared without navigating to another heading
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 169
- Forks
- 484
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 6
Description
Describe the bug
-
Across multiple docs pages on JSON Schema, clicking a heading applies a persistent highlight due to CSS :target styling.
-
After clicking a heading (e.g. “Benefits of being a silver sponsor”), the highlight cannot be removed by:
- Clicking the same heading again
- Clicking anywhere else on the page
- Scrolling
-
The only way to remove the highlight is to click another heading (changing the URL hash).
-
This creates a “stuck highlighted” state and degrades the reading experience.
Steps To Reproduce
- Open the page above
- Click on the heading “Benefits of being a silver sponsor”
- Notice the heading becomes highlighted
- Try to remove the highlight by clicking elsewhere → it remains
- Click a different heading → previous highlight disappears
Expected Behavior
The highlight applied by :target should be cleared when:
- Clicking anywhere outside headings, or
- Clicking the same heading again
This is the behavior followed by most documentation sites (e.g. MDN, GitHub Docs).
Screenshots
https://github.com/user-attachments/assets/3ab23b94-c838-499a-92b9-c1678bb2a858
Device Information [optional]
- OS:Ubuntu (Latest)
- Browser:Brave
- version:
Are you working on this issue?
Yes
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
No
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue on the affected JSON Schema documentation page, using the “Benefits of being a silver sponsor” heading, then inspect the heading-anchor behavior and CSS :target styling. Done means the highlight is removed when clicking outside headings or clicking the same heading again, while changing to another heading still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, html
- Domain
- documentation, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100