Skip to content

fix(ADBLABS-210: top of page header spacing - #123

Open
luisSilvaEs wants to merge 4 commits into
mainfrom
fix/top-of-page-header-spacing
Open

luisSilvaEs wants to merge 4 commits into
mainfrom
fix/top-of-page-header-spacing

Conversation

@luisSilvaEs

Copy link
Copy Markdown
Collaborator

Summary of changes

  • Add mobile padding-block-start to the page-header section so Research, Workflows, Sneaks, and Policy pages get breathing room below the sticky header instead of sitting flush against it
  • Fix the mobile logo touch target sizing so the header block renders at the same computed height as its sticky wrapper (previously ~5px taller, causing it to overflow its reserved space)

Relevant Links

Test URLs:

Checklist

  • This PR has visual changes, and has been reviewed by a designer.
  • This PR has code changes, and our linters still pass.
  • This PR affects production code, so it was browser tested (see below).

Validation

  1. Make sure all PR checks have passed.
  2. Pull down the branch and run locally or view on the PR testing link.
  3. Verify the implementation against the design and story requirements.

Validation steps

  • On mobile widths, Research, Workflows, Sneaks, and Policy show a 16px gap between the header and the page-header content, with the section's background (if any) flush against the header — no exposed white seam
  • In DevTools, <header> (sticky wrapper) and .header (block) report the same computed height on mobile (64px) — no overflow of .header past its wrapper
  • Homepage and article pages (full-screen hero) are unaffected — header still overlaps the hero as designed, no new gap introduced
  • Desktop (≥48rem) header sizing and page-header spacing are unchanged
  • The logo link's touch target remains at least 44x44px despite the negative margin

Browser Testing

We should aim to support the latest version of the listed browsers. For older versions or other browsers not on the list, content should be accessible, even if it doesn't completely match the designs.

Developers should test as they work in the browsers available on their machines. If they have access to other devices to test other browser/OS combinations, they should do that when possible.

Blocks and pages should undergo comprehensive testing to ensure they work as expected in real-use scenarios. Standard testing during pre-production should include at least these browsers.

  • Firefox
  • Chrome
  • Safari

Dark mode and light mode

Most pages support both dark and light mode, based on prefers-color-scheme.
Changes that affect the frontend should support both color schemes.

  • Frontend changes have been tested in both light mode and dark mode.

…t spacing below sticky header on Research, Workflows, Sneaks, and Policy pages
… so the header no longer renders taller than its sticky wrapper
@aem-code-sync

aem-code-sync Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@aem-code-sync

aem-code-sync Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Page Scores Audits Google
📱 / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Comment thread blocks/header/header.css Outdated
box-sizing: border-box;
min-inline-size: 2.75rem;
min-block-size: 2.75rem;
margin-block: -0.125rem;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be a good idea to avoid having to add a negative margin.

Could we adjust the height and padding of these elements so they are the correct height and a negative margin is not needed? Inspecting a bit, it seems like the issue is that the header__bar has too much block padding, so the 44x44 header__brand doesn't fit in it. I think we can just reduce the block padding so it fits; it looks like things are already vertically centered within it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, totally missed that. Fixed.

Comment thread styles/styles.css Outdated
Comment on lines +1042 to +1049
/* page-header leads the page on index templates (Research, Workflows, Sneaks,
Policy); give it breathing room below the sticky header on mobile. */
@media (width < 48rem) {
main > .section.page-header-container:first-of-type {
padding-block-start: var(--s2a-spacing-md, 1rem);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about if the page does not start with the page header block? Can we handle this space generally for the top of all non-article pages? That way content editors are less limited in how they set up a page.

Examples where I would also expect to see space:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — my original thinking was that we'd steer authors toward starting pages with page-header (or document it as a content guideline) rather than handle it in CSS, so I scoped the fix narrowly. But a generic solution is more robust and doesn't rely on authors remembering a convention, so I've updated the rule to target any first section that doesn't already manage its own top spacing (rounded/colored sections and full-screen heroes are excluded since they already handle it).

Derive header__bar's mobile padding from --header-bar-height and the
44px touch target so items fit without overflow, matching the sticky
wrapper's height.
Generalize the sticky-header spacing fix from page-header specifically
to any first section lacking its own top padding, so pages that don't
start with page-header aren't excluded.

This branch was successfully deployed

1 active deployment
fix/top-of-page-header-spacing — 7dd636f5 Deployed Oct 2, 2026 by aem-code-sync[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants