Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !33027

Revamp sticky header offset to improve a11y

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge main-fod-docs-sticky-header into main Feb 09, 2021
  • Overview 3
  • Commits 2
  • Pipelines 0
  • Changes 1

Created by: ffoodd

Our current trick works great for headings or landmarks :targeted by links activation, however it still allows focus to be hidden under the sticky header.

  1. Go to any docs page,
  2. use a TOC link to scroll down the page,
  3. then Shift+Tab to navigate backward using keyboard.

You should see on some browsers (mainly Firefox from my tests, but it used to do the same in Chrome) that focused elements isn't visible, hidden by our sticky header.

Applying scroll-padding-top to the :root solves this without any side-effect—but it requires to drop scroll-margin-top for anchors to prevent doubling the offset.

FWIW based on my test, Edgium and Chromium don't really care since they seem to have a new heuristic for such cases, making the focused element scroll to the center of the view.

Friendly ping @mdo @patrickhlauke if you have any concerns or insights on this.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: main-fod-docs-sticky-header