Skip to content

Mobile ToC anchor navigation scrolls headings under the sticky “On this page” bar #1406

Description

@h-enk

Description

Image

On mobile screens, tapping a link in the “On this page” table of contents does not scroll the target heading fully into view. The page jumps to the correct anchor, but the heading ends up partially hidden beneath the sticky “On this page” bar at the top of the content area.

Steps to reproduce

  1. Open any docs page on a mobile viewport.
  2. Expand or use the “On this page” table of contents.
  3. Tap a heading link, for example on the accessibility page.
  4. Observe the target section after the scroll completes.

See also: #1405

Expected result

The linked heading should remain fully visible after navigation, with enough top offset to account for the sticky mobile header / ToC bar.

Actual result

The linked heading is aligned too close to the top of the viewport and is partly covered by the sticky mobile ToC bar.

Notes

This appears to be an anchor offset issue specific to small screens where the sticky “On this page” navigation is present.

Environment

hugo v0.157.0-7747abbb316b03c8f353fd3be62d5011fa883ee6+extended windows/amd64 BuildDate=2026-02-25T16:38:33Z VendorInfo=gohugoio
11.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions