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
  • Issues
  • #35073
Closed
Open
Issue created Sep 28, 2021 by Administrator@rootContributor

offcanvas in navigation (navbar expand) default z-index to 1000 will cover other elements

Created by: yurj

https://github.com/twbs/bootstrap/blob/main/scss/_navbar.scss#L204

In an navbar-expand element, offcanvas z-index is 1000. When the opener is clicked, it is set to $zindex-offcanvas (usually 1045): https://github.com/twbs/bootstrap/blob/main/scss/_offcanvas.scss#L4

If there's another element in the page with z-index greater than 0 that overlaps the navbar with offcanvas, part of the navbar will be over the element (the offcanvas one), while the remanent part of the navbar will stay below. Below an jsbin example, above the lg breakpoint, the first navigation bar is overlapped totally, the second one is overlapped partially (not in the offcanvas part, due to the z-index: 1000).

Proposal: set z-index: auto at https://github.com/twbs/bootstrap/blob/main/scss/_navbar.scss#L204, I can't see any need to set it to 1000 because it should act as the other elements when not active as offcanvas. When active, let javascript set it to $zindex-offcanvas (1045) (or other css way if possible)

Use case: mostly sidebars (for example an admin one when logged) which can easly overlap with a navbar/visible offcanvas element.

Demo: https://output.jsbin.com/veviwuqefa/ Version: Bootstrap 5.1.1 Browsers: Mozilla Firefox 78.14.0esr (64-bit) and Chrome 94.0.4606.61 (official Build) (64 bit) OS: Debian Linux

Assignee
Assign to
Time tracking