Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using mobile_top_margin with heading component #3489

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

andysellick
Copy link
Contributor

@andysellick andysellick commented Dec 20, 2024

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What

Change how we use the heading component margin options in consultations pages.

Why

We're removing this option from the heading component because there's some very specific behaviour on these pages and we should move away from corner cases like this to a spacing model that works across pages.

Relates to alphagov/govuk_publishing_components#4510

Visual changes

Some minor spacing changes.

Consultations pages headings have slightly smaller spacing below on desktop and above on mobile.

Before (desktop) After (desktop)
Screenshot 2025-01-07 at 12 02 48 Screenshot 2025-01-07 at 12 02 54
Before (mobile) After (mobile)
Screenshot 2025-01-07 at 12 00 55 Screenshot 2025-01-07 at 12 01 01

Call for evidence pages headings have a similar change.

Publications are similar, although I'm not sure of an example of a publication page.

Trello card: https://trello.com/c/l4VyD7Nm/395-retire-page-title-component

@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3489 December 20, 2024 13:43 Inactive
@andysellick andysellick changed the title [DO NOT MERGE] Reconfigure heading margins [DO NOT MERGE] Stop using mobile_top_margin with heading component Dec 20, 2024
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3489 December 20, 2024 13:58 Inactive
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3489 December 20, 2024 14:03 Inactive
- previously using the responsive margin bottom mixin, but this doesn't provide enough spacing on consultation pages
- instead switch to using the component wrapper helper, which includes an option to set margin bottom
- set margin bottom to match existing (on desktop, better on mobile)
- headings have this unusual behaviour where the mobile top margin is much larger
- this is slightly odd and inconsistent behaviour, so we're removing this option from the heading component and applying custom spacing in these pages instead using existing component options
- headings have this unusual behaviour where the mobile top margin is much larger
- this is slightly odd and inconsistent behaviour, so we're removing this option from the heading component and applying custom spacing in these pages instead using existing component options
- headings have this unusual behaviour where the mobile top margin is much larger
- this is slightly odd and inconsistent behaviour, so we're removing this option from the heading component and applying custom spacing in these pages instead using existing component options
@andysellick andysellick force-pushed the reconfigure-headings branch from 254ddba to c96d79f Compare January 7, 2025 11:56
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3489 January 7, 2025 11:56 Inactive
@andysellick andysellick changed the title [DO NOT MERGE] Stop using mobile_top_margin with heading component Stop using mobile_top_margin with heading component Jan 7, 2025
@andysellick andysellick marked this pull request as ready for review January 7, 2025 12:08
Copy link
Contributor

@AshGDS AshGDS left a comment

Choose a reason for hiding this comment

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

LGTM 👍

component_helper.set_lang("en")
component_helper.add_data_attribute({ module: "ga4-link-tracker" })
component_helper.add_data_attribute({ ga4_track_links_only: "" })
component_helper.add_data_attribute({ ga4_link: { event_name: "navigation", type: "callout" } })
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: is it worth combining the data attribute statements? No worries if you think it's more readable separated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair question, but yeah, I think it's probably more readable like this.

@andysellick andysellick merged commit 90cf538 into main Jan 7, 2025
11 checks passed
@andysellick andysellick deleted the reconfigure-headings branch January 7, 2025 13:25
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.

3 participants