Skip to content

Simplify hosted content header#15420

Draft
cemms1 wants to merge 5 commits intomainfrom
cemms1/simplify-hosted-header
Draft

Simplify hosted content header#15420
cemms1 wants to merge 5 commits intomainfrom
cemms1/simplify-hosted-header

Conversation

@cemms1
Copy link
Contributor

@cemms1 cemms1 commented Feb 24, 2026

What does this change?

  • Specifies the header element as the semantic HTML element for the header in the Section parent component for the Hosted content page layouts

HostedContentHeader updates:

  • Removes the "About" text
  • Sets the width of the logo + advertisement content label as 132px across all breakpoints
  • Adds an i icon button to the advertisement content label
  • Moves the "hosted by" text to the bottom left of the Guardian Logo and updates the text colour
  • Adjusts the CSS for the header and removes wrapper components in favour of keeping the HTML definition closer together
    • Uses the CSS styles as a way to name/annotate the div layers
  • Removes extra nested div elements from the DOM tree for HostedContentHeader

Why?

Tweaking the page layouts for the Hosted Content pages to bring them closer to our new, reworked designs for these pages for the migration

Screenshots

Screenshot
Before (frontend) before
Before (DCR) before2
After (DCR) after

@github-actions
Copy link

github-actions bot commented Feb 24, 2026

Comment on lines -22 to -23
const HOSTED_CONTENT_HEIGHT_MOBILE = 48;
const HOSTED_CONTENT_HEIGHT_DESKTOP = 58;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These values are only used in one place: the headerWrapperStyles below so don't need to be defined as constants at the top of the file

Comment on lines +43 to +51
width: ${breakpoints.desktop}px;
}

${from.leftCol} {
max-width: 71.25rem;
width: ${breakpoints.leftCol}px;
}

${from.wide} {
max-width: 81.25rem;
width: ${breakpoints.wide}px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prefer to use the breakpoint definitions directly rather than to hardcode rem values

Comment on lines +68 to +69
/** Hard-coded to fit. TODO - address this */
font-size: 13px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to talk to design about this. The designs don't work in practice

height: auto;
top: 100%;
text-align: center;
z-index: 10;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

10 seems a bit arbitrary. We should only need 1 to ensure it falls on top of the main content. If using a value other than 1, better to use the function getZIndex since this is more predictable across pages compared to manually specifying z-index values

>
<HostedContentHeader
branding={branding}
accentColor={branding.hostedCampaignColour}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we already have access to hostedCampaignColour in the branding object, there's no need to pass it through as a separate prop

@cemms1 cemms1 force-pushed the cemms1/simplify-hosted-header branch from a4e7d71 to 95ab406 Compare February 24, 2026 16:28
@github-actions
Copy link

github-actions bot commented Feb 24, 2026

@cemms1 cemms1 added the run_chromatic Runs chromatic when label is applied label Feb 24, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Feb 24, 2026
@cemms1 cemms1 force-pushed the cemms1/simplify-hosted-header branch from 95ab406 to 80b5b54 Compare February 25, 2026 17:51
@cemms1 cemms1 added the run_chromatic Runs chromatic when label is applied label Feb 25, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant