Skip to content

Fix blog post TOC: sticky scroll, active section highlight with left border indicator, and separator line#1667

Merged
sanjay-kv merged 3 commits into
mainfrom
copilot/fix-table-of-content
May 23, 2026
Merged

Fix blog post TOC: sticky scroll, active section highlight with left border indicator, and separator line#1667
sanjay-kv merged 3 commits into
mainfrom
copilot/fix-table-of-content

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

Description

Blog post TOC was not sticky during scroll, had no active-section highlighting, and lacked a visual separator between content and TOC columns. Updated to match the reference design with a left border indicator for the active section.

Type of Change

  • New feature (e.g., new page, component, or functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • UI/UX improvement (design, layout, or styling updates)
  • Performance optimization (e.g., code splitting, caching)
  • Documentation update (README, contribution guidelines, etc.)
  • Other (please specify):

Changes Made

src/css/custom.css — Section 15 (blog layout)

  • Sticky TOC: Added align-self: stretch to .col.col--2 so the column spans full page height (prerequisite for sticky to work past the TOC's natural height). Inner div gets position: sticky, top: navbar-height + 1rem, max-height, and overflow-y: auto.

  • Active highlighting with left border indicator: Styled .table-of-contents__link--active with var(--ifm-color-primary) + font-weight: 600 + a 2px solid left border in the primary color. This creates a visual bar indicator beside the active section, matching the reference design. Docusaurus already manages the active class via IntersectionObserver — only the styles were missing.

  • Vertical track line: Added border-left: 2px solid var(--ifm-toc-border-color) to the .table-of-contents list itself, creating a continuous vertical track that the active indicator overlays.

  • Separator line: Added border-left: 2px solid var(--ifm-toc-border-color) to the TOC column for a clear visual separation between content and TOC.

  • Hover transition: Non-active TOC links transition to primary color on hover.

  • Mobile: Sticky and border-left are disabled at ≤996px where the layout stacks vertically.

Dependencies

  • None.

Checklist

  • My code follows the style guidelines of this project.
  • I have tested my changes across major browsers and devices
  • My changes do not generate new console warnings or errors .
  • I ran npm run build and attached screenshot(s) in this PR.
  • This is already assigned Issue to me, not an unassigned issue.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recode-website Ready Ready Preview, Comment May 23, 2026 4:59am

…or line on blog posts

- Add align-self: stretch to TOC column so sticky works for full page height
- Add sticky positioning to inner TOC div (position: sticky with max-height + overflow)
- Style table-of-contents__link--active with primary color and bold weight
- Add hover color transition for TOC links
- Add left border separator between content and TOC columns
- Disable sticky and border on mobile layout

Agent-Logs-Url: https://github.com/recodehive/recode-website/sessions/4aa3db4e-b68f-4f90-9097-425a59ce5d85
Copilot AI changed the title [WIP] Fix table of content on blog post pages Fix blog post TOC: sticky scroll, active section highlight, and separator line May 23, 2026
Copilot AI requested a review from sanjay-kv May 23, 2026 04:14
@sanjay-kv
Copy link
Copy Markdown
Member

@copilot

need some changes
image

refernce image:
image

- Add left border highlight on the active TOC link matching reference design
- Make separator line between content and TOC more prominent (2px)
- Add vertical track line on TOC list for visual continuity
- Adjust padding/margins for left border indicator alignment

Agent-Logs-Url: https://github.com/recodehive/recode-website/sessions/7e16fff0-8b1c-4f04-b52d-06ac60d246d8
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 23, 2026

@copilot

need some changes
...

Updated in 0faa377. The TOC now has:

  • A left border indicator (blue bar) that highlights the active section as you scroll
  • A more prominent vertical separator line between content and TOC
  • A vertical track line along the TOC list for visual continuity

TOC with active indicator

Here's how it looks after scrolling — "2. Dataset: The Pointer" is highlighted with the left border indicator matching the reference design.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • codeharborhub.github.io
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Fix blog post TOC: sticky scroll, active section highlight, and separator line Fix blog post TOC: sticky scroll, active section highlight with left border indicator, and separator line May 23, 2026
@sanjay-kv sanjay-kv marked this pull request as ready for review May 23, 2026 05:01
@sanjay-kv sanjay-kv merged commit 5991db9 into main May 23, 2026
7 checks passed
@sanjay-kv sanjay-kv deleted the copilot/fix-table-of-content branch May 23, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table of content fix on the blog posts

2 participants