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
  • !37926

Docs: add scroll-margin-top for keyboard navigation

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Patrick H. Lauke requested to merge patrickhlauke-docs-scroll-margin into main Jan 21, 2023
  • Overview 3
  • Commits 1
  • Pipelines 0
  • Changes 2

Description

Adds scroll-margin-top to the documentation styles https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-top

Motivation & Context

When navigating with the keyboard, if you scroll down a documentation page and then navigate in reverse (Shift+Tab), keyboard focus can land behind the sticky header. This small CSS addition prevents this from happening.

With a hat-tip to @joelamyman for the inspiration.

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Video

Screen recording showing the reverse keyboard navigation before (with me jiggling the mouse at the top whenever keyboard focus is obscured by the sticky header) and after this addition.

https://user-images.githubusercontent.com/895831/213894362-fd4a659e-9e36-460a-87af-cbbc8636f8f9.mp4

Note that code blocks still seem to have a funky behaviour, but this looks more like a browser bug/shortcoming.

Live previews

https://deploy-preview-37926--twbs-bootstrap.netlify.app/docs/5.3/getting-started/introduction/#community

Scroll down/jump to "Community", then navigate in reverse using Shift+Tab

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: patrickhlauke-docs-scroll-margin