Unnecessary whitespace at the top of custom module-created pages where nav top bar should be

Created on 26 June 2025, 10 days ago

Problem/Motivation

I've created a custom page following the steps shown in https://www.drupal.org/docs/develop/creating-modules/create-a-custom-page-using-a-controller β†’ where I've embedded an LLM chatbot. My entire site has a set to position: sticky, so that the header is always visible on the page. On most pages created through the Drupal UI, there is now the new navigation top bar at the top of the page which is exactly 54px high and is represented in the devtools as so:

<aside class="top-bar" data-drupal-admin-styles="" aria-labelledby="top-bar__title" data-offset-top="">...</aside>

For most pages, this works just fine. On the frontend, the new navigation top bar pushes my sticky header down 54px and both the new navigation top bar and my header stay sticky and I'm able to scroll the page with both remaining in view.

However, on this custom page, there's an empty space at the top the exact 54px height of the nav top bar which is NOT there, causing the sticky header to overlap the content below it.

Steps to reproduce

Create a custom page as shown on https://www.drupal.org/docs/develop/creating-modules/create-a-custom-pag... β†’ and view the page at the path created. You'll need to have some type of header or other content immediately after the navigation top bar that is set to position: sticky to see the issue.

πŸ› Bug report
Status

Active

Version

5.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States dalemoore

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

Comments & Activities

Production build 0.71.5 2024