Skip to content

Fix logo position in Titlepiece component - #14541

Merged
cemms1 merged 2 commits into
mainfrom
cemms1/fix-logo-in-masthead
Sep 23, 2025
Merged

cemms1 merged 2 commits into
mainfrom
cemms1/fix-logo-in-masthead

Conversation

@cemms1

@cemms1 cemms1 commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

What does this change?

Adjusts the alignment of the logo in the header (Titlepiece component) for the mobileMedium breakpoint

Does this by

  • reverting the change in Use The Whole Picture Guardian logo in campaign #14527 to bring the logo positioning styles back into the Titlepiece component
    • This makes it easier to understand the grid and relative positioning offsets because everything is in the same component. Leaving grid CSS definitions away from where the grid is defined makes it tricky for future developers to understand
    • This also keeps the component concerns different: the Logo component is purely to control which logo appears; the Titlepiece component brings together all the separate sub components into a header component
    • Fixes the bug by removing an override for the logo from mobileMedium

Also adds three chromatic snapshot breakpoints to help to capture these issues earlier in future

Why?

I noticed a positioning bug which occurred after some recent work on the Titlepiece component. Since the logo is clickable and the menu has a higher z-index, this prevents users from being able to click "home" easily on mobileMedium and mobileLandscape sized screens.

Screenshots

Before After
before after

@cemms1
cemms1 force-pushed the cemms1/fix-logo-in-masthead branch from 6037226 to 2572abe Compare September 22, 2025 14:48
@cemms1 cemms1 changed the title fix logo position in masthead Fix logo position in Titlepiece component Sep 22, 2025
@github-actions

github-actions Bot commented Sep 22, 2025

Copy link
Copy Markdown

@cemms1 cemms1 added the run_chromatic Runs chromatic when label is applied label Sep 22, 2025
@github-actions

github-actions Bot commented Sep 22, 2025

Copy link
Copy Markdown

@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Sep 22, 2025
@domlander

domlander commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

This makes it easier to understand the grid and relative positioning offsets because everything is in the same component. Leaving grid CSS definitions away from where the grid is defined makes it tricky for future developers to understand.

Fully agree with this point. I was trying to get the logo styles inside the logo component as I think it make sense for them to belong there (e.g. the SVG styles), but agree that the grid styling should live in the Titlepiece component.

Fixes the bug by removing an override for the logo from mobileMedium

Chromatic is showing that the logo has moved to the left in many snapshots on larger screen sizes. I don't think this was intended?

…nt whole picture logo rendering for slim nav variation
@cemms1 cemms1 added the run_chromatic Runs chromatic when label is applied label Sep 22, 2025
@cemms1
cemms1 marked this pull request as ready for review September 22, 2025 16:31
@cemms1
cemms1 requested a review from domlander September 22, 2025 16:31
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Sep 22, 2025
@cemms1

cemms1 commented Sep 22, 2025

Copy link
Copy Markdown
Contributor Author

This makes it easier to understand the grid and relative positioning offsets because everything is in the same component. Leaving grid CSS definitions away from where the grid is defined makes it tricky for future developers to understand.

Fully agree with this point. I was trying to get the logo styles inside the logo component as I think it make sense for them to belong there (e.g. the SVG styles), but agree that the grid styling should live in the Titlepiece component.

I actually think the logo sizing and positioning should be adjusted from outside of the component. We should be able to update the svg sizing using props rather than targeting svg from the outer component CSS, so I get that part! But I think logo should be able to be as flexible as possible and not need to know any context about where it's being used

Chromatic is showing that the logo has moved to the left in many snapshots on larger screen sizes. I don't think this was intended?

Thanks for spotting that! I'd missed how I'd accidentally tweaked styles I didn't mean to! I've hopefully fixed that now 🙏

@cemms1
cemms1 merged commit d45127a into main Sep 23, 2025
32 checks passed
@cemms1
cemms1 deleted the cemms1/fix-logo-in-masthead branch September 23, 2025 08:25
@gu-prout

gu-prout Bot commented Sep 23, 2025

Copy link
Copy Markdown

Seen on PROD (merged by @cemms1 8 minutes and 58 seconds ago) Please check your changes!

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.

2 participants