Gin makes Navigation toolbar position fixed

Created on 19 June 2025, 4 days ago

Problem/Motivation

If you enable both core Navigation module, and Gin Toolbar module, the Gin theme sets the position of the navigation toolbar to fixed, while it needs to be set to sticky to not overlay the content of the page:

Steps to reproduce

Enable Navigation module and Gin Toolbar module

Proposed resolution

Change CSS positioning from fixed to sticky. This is the code: https://git.drupalcode.org/project/gin/-/tree/5.0.x/styles?ref_type=head...

Note: It was changed in this commit from 2 days ago, so could be there were good reasons for it: https://git.drupalcode.org/project/gin/-/commit/077c77768c82e898379515bc...

🐛 Bug report
Status

Active

Version

5.0

Component

Code

Created by

🇳🇴Norway vegardjo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @vegardjo
  • 🇳🇴Norway vegardjo

    After some more investigation: it should likely be fixed for Gin theme in the backend, but typically not for the frontend theme.

    One way around is adjusting the margin on:

    .gin--navigation-top-bar--offset {
      margin-top: calc(54px + var(--gin-spacing-s));
    }
    

    ..or maybe a safer way around, set it back to sticky, but make an override for the admin pages, typically .path-admin [...] {display:fixed}

  • 🇩🇪Germany jurgenhaas Gottmadingen

    There are some explicit decisions in Gin's top-bar.css where I'm not aware why:

    Problem 1: top position of the main canvas

    The navigation module sets that to the height of the top bar:

      .top-bar:has(.top-bar__tools:not(:empty), .top-bar__context:not(:empty), .top-bar__actions:not(:empty)) ~ .dialog-off-canvas-main-canvas {
        margin-block-start: var(--admin-toolbar-top-bar-height);
      }
    }

    Gin sets the margin-block-start: 0 which is because Gin also sets the height of the top bar to auto, so it doesn't know the height.

    Problem 2: top bar opacity

    Gin sets opacity and a blur on the top bar.

    We need to find out why that has been don that way before we make any changes. @saschaeggi could you please throw some light on this?

  • First commit to issue fork.
  • 🇩🇪Germany jurgenhaas Gottmadingen

    This is awesome, thanks @saschaeggi for fixing this.

  • 🇨🇭Switzerland saschaeggi Zurich

    Note that the navigation module does not set sticky so we kept the fixed state

  • Pipeline finished with Skipped
    3 days ago
    #527049
  • Pipeline finished with Skipped
    3 days ago
    #527050
  • 🇩🇪Germany jurgenhaas Gottmadingen
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Note: The opacity and blur, that I described a "Problem 2" in #3 is by design.

Production build 0.71.5 2024