WordPress / WordPress/wordpress.org

Sidebar TOC: bold/highlight the current section while scrolling

Open
#545 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
163
Forks
221
PR merge metrics
No merged PRs in 30d

Description

What

On pages that include a sidebar table-of-contents / in-page navigation (list of headings), it would be helpful to visually highlight the currently active section as the reader scrolls.

Why

On long pages it’s difficult to tell where you are in the document. A clear active state improves navigation and readability.

Expected behavior

  • As the user scrolls, the sidebar item corresponding to the heading currently in view becomes bold (or otherwise clearly “active”).
  • The active state updates as the user enters the next/previous section.
  • Clicking a TOC item should also set the correct active state.

Actual behavior

  • Sidebar items don’t clearly indicate the current section while scrolling in the Table of Contents located in the sidebar.

Suggested implementation

Add scrollspy behavior (IntersectionObserver) to toggle an active class based on headings in view.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the sidebar Table of Contents implementation and the code that renders or links its headings; then trace how scrolling and TOC clicks are handled. Done means the heading in view has a clear active or bold state, the state changes between sections, and clicking a TOC item selects the corresponding section.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.