Repository navigation
[BootstrapAdminUi] Port the sticky page header from Sylius - #413
Merged
TheMilek merged 1 commit intoNov 23, 2026
Merged
Conversation
The create and update forms were glued to the page header: the header had no bottom padding, and only the index pages render a ".page-body" with a top margin. Port "_layout.scss" and "sticky-header.js" from the Sylius admin, as is: the page header gets the page vertical padding and sticks to the top of the page (with a border and a shadow once stuck), and ".page-body" no longer adds its own margin. The header template already had the "data-sticky-header" attribute. Same spacing on every page, no markup change, and one difference less with the Sylius admin.
This was referenced Nov 23, 2026
TheMilek
approved these changes
Nov 23, 2026
Comment on lines
+12
to
+17
| position: sticky; | ||
| top: -1px; | ||
| z-index: 999; | ||
| margin-top: 0; | ||
| padding-top: var(--tblr-page-padding-y); | ||
| padding-bottom: var(--tblr-page-padding-y); |
Member
There was a problem hiding this comment.
Suggested change
| position: sticky; | |
| top: -1px; | |
| z-index: 999; | |
| margin-top: 0; | |
| padding-top: var(--tblr-page-padding-y); | |
| padding-bottom: var(--tblr-page-padding-y); | |
| margin-top: 0; | |
| padding-top: var(--tblr-page-padding-y); | |
| padding-bottom: var(--tblr-page-padding-y); | |
| &[data-sticky-header] { | |
| position: sticky; | |
| top: -1px; | |
| z-index: 999; | |
| } |
The header template only renders data-sticky-header when sticky_header is not disabled, but this rule makes every .page-header sticky. With sticky_header: false the header still sticks, it just never gets is-sticky, so it has no background and the form scrolls underneath the title and the buttons.
I checked it with the built assets from this PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On create and update pages, the form card is glued to the page header: the "Cancel" / "Update" buttons touch the card. The header has no bottom padding, and only the index pages render a
.page-bodywith a top margin.The Sylius admin solves it in CSS, with the same templates. This PR ports its
_layout.scssandsticky-header.jsas is (a follow-up listed in #404):.page-headergets the page vertical padding,.page-bodyno longer adds its own margin: same 24px gap on every page;data-sticky-headerattribute;Measured on the demo, talk edit page: header → card 0px before, 24px after. Invalid form: header → alert 24px, alert → card 16px, as in Sylius. Index pages are unchanged (24px).
It keeps BootstrapAdminUi closer to the Sylius admin templates and styles, which should be merged at some point. It is an alternative to #401 and #375, which fix the same gap by changing the markup or the hooks.
public/assets were rebuilt withyarn build.Screenshots
Talk edit page of the demo application, default theme.
Valid form
Invalid form
Sticky header, after scrolling