Steps to reproduce
- Install navigation module
- Navigate to a page with the top bar (like a node)
- Note that the left toolbar does not extend all the way to the bottom of the viewport.

Proposed resolution
Remove the line of CSS that's causing the issue.
Some context
What is Drupal.displace() and how does it work.
Drupal.dispace() is a JS function that looks for attributes like data-offset-top, data-offset-left, etc. These are meant to be used by "sticky" position: fixed admin UI elements. And if used properly, will inform the front-end code how to properly place itself on the top of the page. For example, we don't want a fixed header to obscure the admin toolbar (or vice-versa).
So when Drupal.displace() is ran, it'll look for those data-offset properties, return the object, and also update those CSS vars that you're seeing.
(I should really turn this into a blog post).
Anyway, since the navigation's toolbar is fixed to the top, we definitely want that attribute on it.
Why was that line of CSS introduced?
To be honest, I might have done that back in the day (it looks like something that I would have written). When this was written, the top bar did not yet exist. And even though that didn't exist, there are other top bars (e.g. the old workspaces UI). So we needed to accommodate that.
For the Navigation module, the left toolbar is expected to go full height -- even if the the top bar exists. So the fix is simple. We need to just remove the one line of CSS.
| Comment | File | Size | Author |
|---|---|---|---|
| #79 | configure.jpg | 132.48 KB | rkoller |
| #70 | Workspaces___Drush_Site-Install_and_html_html_twig_—_drupal.png | 111.91 KB | mherchel |
| #70 | Workspaces___Drush_Site-Install.png | 107.39 KB | mherchel |
| #64 | after.png | 50.47 KB | mherchel |
| #64 | before.png | 57.43 KB | mherchel |
Issue fork drupal-3531516
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
f0ns commentedI've added the css to fix this:
https://git.drupalcode.org/issue/drupal-3531516/-/commit/8fda91d0d4805a5...
I've patched my sites with it and everything works as expected now.
Comment #3
f0ns commentedComment #4
pierregermain commentedHello,
I was able to reproduce the visibilty error visiting the /user/1 page Screenshot:

After testing on Gitpod using Drupal 11.2.1-dev and applying
height: 100%from the patch provided makes the navigation bar correctly take up the full height.I think this fix is ready for a merge request.
Comment #5
pierregermain commentedI’ve tested the patch on various admin pages, and it works as expected.
Many thanks to f0ns for the fix!
Comment #6
f0ns commentedThank you for testing, i’ll leave it on needs review for now and see if we can have an extra pair of eyes on this one.
Comment #7
cilefen commentedIt would be ideal to know which commit caused this.
Comment #8
xjmThanks @f0ns. Your issue fork seems to be out of sync or perhaps created against a different source branch. Can you create a branch and merge request containing only the commit for your fix? Thanks!
Comment #10
f0ns commentedComment #11
f0ns commented@xjm it should be fixed now. Thanks!
Comment #14
smustgrave commentedComment #15
sandip commentedI go though the issue and got that this issue is occured beacuse of
block-size: calc(100vh - var(--drupal-displace-offset-top, 0px));see the codebase link Code Link in line 95. In olivero frontend theme--drupal-displace-offset-topis set to 64px that's why navigation bar height is not getting 100%. In claro Admin theme i saw that--drupal-displace-offset-topis set not defined so we can see full height of navigation bar in claro. I am attaching images for clarity. Please share your thoughts.Comment #16
sandip commentedI think may be we can remove the line
block-size: calc(100vh - var(--drupal-displace-offset-top, 0px));Before:
After:
Comment #17
f0ns commentedYou might be right, I did not notice this css at first.
I’ll test this and get back on this.
Comment #18
f0ns commentedComment #21
f0ns commentedComment #22
f0ns commentedThe suggestion indeed also fixes the problem and seems to me that this is a better solution (delete one line of CSS instead of adding one line of CSS).
Please review!
Comment #23
neptune-dc commentedI was able to visually confirm the patch successfully fixes the height of the navigation bar by visiting `/user/1`
I agree that this solution that deletes css is the superior fix.
I have added screenshots as evidence.
Comment #24
catchIt would be good to check which issue added that line of CSS and whether it was added to fix a specific issue (or if it's not clear why it's there in git blame, e.g. added without comment as part of a larger change).
Comment #25
sandip commentedI saw this line is introduced in this issue queue https://www.drupal.org/project/drupal/issues/3484564. Here is the MR -> MR Link.
But it is not clear to me what issue it was fixing by decreasing the height from 100vh. Can you please look into it.
Comment #26
godotislateThere is also #3526180: Regression: Drupal.displace() not working on new Navigation module in 11.2, which should have been fixed, but might be affecting something here.
Comment #27
f0ns commentedI think it depends on how you see the sidebar vs the topbar.
Since the sidebar holds the logo I personally feel it should always be 100% height and the header shouldn't overlap it or push it down because the logo wouldn't be in the lefthand top corner in this case which feels visually weird.
Comment #28
godotislatePer @finnsky on Slack, the regression actually came from #3526266: Navigation top bar should utilize Drupal.displace().
Comment #29
finnsky commentedMaybe it's not. :)
I'm not sure right now.
The top bar was added in a hurry and we need to review how it works with displace
Comment #30
catch@f0ns that seems to be the behaviour already, the top bar starts from the right edge of the sidebar for me.
Comment #31
f0ns commentedThen I can’t think of a case where you need to calc the height dynamically where it’s not 100% of the height for the sidebar.
Comment #32
svendecabooterI can confirm the fix in MR 12461 restores the height of the navigation sidebar.
Comment #33
f0ns commentedComment #34
benjifisherI tested with the current 11.x and reproduced the problem.
Then I reverted
6bdfd060b136(the commit from #3526266: Navigation top bar should utilize Drupal.displace(), 2025-06-04). I re-tested, and the navigation section (admin toolbar) had full height. That is two days later than #3526180: Regression: Drupal.displace() not working on new Navigation module in 11.2, so I think it is fair to say that #3526266 caused this bug, confirming Comment #28. I am adding #3526266 as a related issue.I am setting the status to NW for some automated tests. Otherwise, we will have to go through the same arguments and similar research the next time this feature gets broken. I notice the comment #3526180-8: Regression: Drupal.displace() not working on new Navigation module in 11.2:
This time, can we get a functional test? That is, figure out the various combinations of window size, top bar, and navigation area, and confirm that things fit together the way we want them to?
@finnsky:
Is there already an issue for that? If so, it would help to add it here as a related issue.
Comment #35
benjifisherBy the way, #3526266 changes markup (
core/modules/navigation/templates/top-bar.html.twig) as well as CSS. Let's consider both before making further changes to the CSS.Comment #36
sandip commented@benjifisher, I tried reverted the commit from https://www.drupal.org/project/drupal/issues/3526266 and finds out that the issue caused this height bug.
Now after testing i came to know in this issue data-offset-top attribute is added in
asidetag in top bar's twig file MR Link Issue #3526266. Because of that attribute--drupal-displace-offset-topalong with other left, right and botton displace offset value is initialized and this is why the sidebarblock-size: calc(100vh - var(--drupal-displace-offset-top, 0px));it's height is reducing from 100vh.Instead before this issue https://www.drupal.org/project/drupal/issues/3526266
--drupal-displace-offset-topwas undefined asdata-offset-topwas not added as an attribute in Top Bar'sasidetag, so we were getting full height 100vh of the sidebar.Now i dont know how data-offset-top is related to --drupal-displace-offset-top but this are the things i mentioned above that i noticed.
I think that is the thing for which the height issue occurs due to that issue #3526266 commit. @benjifisher, Could you please share your thought on this.
Comment #37
finnsky commentedThe issue seems more deeper that just height, but about behaviour of Drupal Displace globally
When workspaces enabled we have top displace calculated wrong
https://gyazo.com/52b598ad2bac75476ccc48d88e4ad98c
Comment #39
finnsky commented1. Removed
{% if tools or context|render or actions|render %}
We have css for it. We may avoid it.
2. It is currently impossible to provide a shift of the toolbar and top bar together with displace offset top.
Therefore, let it always be aligned to the top of the screen
The drop-down popover accordingly too.
Workd good even with workspaces. Please review.
Comment #40
finnsky commentedComment #42
sandip commentedAfter this MR
--drupal-displace-offset-topis undefined now. Now i found another regression due to that. Hamberger Icon and Search Box gets overlapped now as there is a regression inborder-top-widthproperty applied in.header-nav. I am attaching before and after image.Before MR:

After MR:

Maybe we have to adjust
border-top-widthof .header-nav without--drupal-displace-offset-topComment #43
finnsky commentedI don't think we need to test Olivero theme here, it is outside of that issue scope.
Comment #44
sandip commented@finnsky, Thank you for the clarification, I tested the MR and it fixes the issues correctly. I am attaching images for better understanding.
Comment #45
grimreaperHi,
Thanks @finnsky.
I have tested MR https://git.drupalcode.org/project/drupal/-/merge_requests/12843, it fixes the issue.
Changing to RTBC as the test failure in the pipeline seems unrelated.
Comment #46
benjifisherI am setting the status back to NW for an update to the issue summary. I already added the missing elements from the standard outline. Please
That will make it a lot easier for others to review your work on this issue.
I would still like to see some automated tests, as I said in Comment #34, but I will not insist on that. I guess the
navigationmodule is still experimental (especially the top bar).From the MR, I see that you
block-sizeandinset-block-startcalculations with fixed values100vhand0display: block;todisplay: flex;and replaced margin with padding{% if ... %} ... {% endif %}around the<aside>element in a Twig file, and removed thedata-offset-topattribute.I can see what was changed, but the issue summary should explain the intention behind those changes.
Comment #47
catchI'm not sure what tests would look like for this (that would actually prevent the regression) except for visual regression tests that we don't have a framework for. If someone does, it would be great to add them here. If there's not a good way to add tests, we should open an explicit follow-up to add them later and add it to the navigation stable meta somewhere.
Comment #48
rkollertesting MR12843, the shift of the footer region is being fixed, but the problem @finnsky highlighted in #37 still persists and the expanded workspaces popup making the workspaces menu item button and the shortcuts menu items inaccessible while the popup is expanded. do i understand #39 correctly and workspaces popup covering parts of the navigation sidebar is impossible to fix at this point?
Comment #49
catchI can't find the core issue, but #3457688: Support for core navigation module has notes for a redesigned workspaces/navigation integration. So if this MR fixes other things but not workspaces, we should probably go ahead here and then fix workspaces in that issue (or open it if it doesn't exist).
Comment #50
f0ns commentedThe fix doesn't apply anymore in the latest upgrade to Drupal 11.2.5, I'll look into it.
EDIT: all fixed, the issue was not related with this patch it was the first in a series of patches that was hanging because of another external problem. All fixed now.
Comment #51
finnsky commentedI see main issue that offcanvas JS
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/misc/dialog/o...
not allows to set multiple top displacers.
https://gyazo.com/d598a5fdfad8d8ac8b6a2e415ec7a303
So we not able to add top shift with both top dialog and top bar.
Comment #52
mherchelI'm going to fix this.
A bit of background to address the comments above:
What is Drupal.displace() and how does it work.
Drupal.dispace()is a JS function that looks for attributes likedata-offset-top,data-offset-left, etc. These are meant to be used by "sticky"position: fixedadmin UI elements. And if used properly, will inform the front-end code how to properly place itself on the top of the page. For example, we don't want a fixed header to obscure the admin toolbar (or vice-versa).So when
Drupal.displace()is ran, it'll look for thosedata-offsetproperties, return the object, and also update those CSS vars that you're seeing.(I should really turn this into a blog post).
Anyway, since the navigation's toolbar is fixed to the top, we definitely want that attribute on it.
Why was that line of CSS introduced?
To be honest, I might have done that back in the day (it looks like something that I would have written). When this was written, the top bar did not yet exist. And even though that didn't exist, there are other top bars (e.g. the old workspaces UI). So we needed to accommodate that.
For the Navigation module, the left toolbar is expected to go full height -- even if the the top bar exists. So the fix is simple. We need to just remove the one line of CSS.
Comment #53
mherchelFrom @catch in #47
Agree. No easy way to currently add tests, and TBH, I don't even believe this is something that will likely break. I'll add a followup
Comment #54
mherchelComment #55
mherchelComment #56
mherchelComment #57
mherchelComment #64
mherchelOK. Easy fix. Hopefully we can get this in for 11.3.
Comment #65
catchThat's pretty clear cut, thanks for the explanation in #52.
Comment #68
godotislateJust double-checking: the changes in MR 13918 look to be the same as MR 12461, which was done on a suggestion from #3531516-16: Admin toolbar height is not 100% since upgrading to Drupal 11.2. There's some back and forth on this after #22, and in that subsequent discussion it's unclear to me whether there are issues with this change. Have all those concerns been resolved?
Comment #69
nod_unfortunately the workspace top bar overlaps with the navigation sidebar, inner menus are fine, we did the same as earlier in this issue 😂
Comment #70
mherchelAdded check for when offcanvas is at top of screen.
Comment #71
nod_Works for me. Conceptually makes sense that everything us pushed by the sidebar
Comment #74
lauriiiThank you! Tested manually and works great.
I noticed that for some reason the workspaces toggle doesn't always open the panel on the top but links to the page. 🤔 That seemed to be a pre-existing issue so maybe something we should work on in a separate issue?
Comment #77
jurgenhaasLooks like this creates a regression. The off-canvas fills the whole screen when it's not displayed on top or bottom, but on the right of the screen.
That's because, even when displayed at the right of the screen, the container has the attribute
data-offset-top="0"Comment #78
jurgenhaasNot sure if the syntax is correct, but we may have to add
&:not:is([data-offset-right])to the selector. And also, could the off-canvas be displayed on the left? If so, that would probably require another addition to the selector.Comment #79
rkollerone example to illustrate the regression would be
admin/config/user-interface/navigation-blockwith the navigation module installed - simply configure one block:the context menus seem to be broken as well and missing styling but that might be unrelated.