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

Card link + section heading spacing #154

Closed
davidhunter08 opened this issue Sep 17, 2024 · 2 comments · Fixed by #159
Closed

Card link + section heading spacing #154

davidhunter08 opened this issue Sep 17, 2024 · 2 comments · Fixed by #159
Labels
bug Something isn't working

Comments

@davidhunter08
Copy link
Collaborator

davidhunter08 commented Sep 17, 2024

NHS App Frontend version

2.1.0

Description

The space between the card link and section heading is too small.

Screenshots

card-spacing-1

A way to fix this is to add padding-top to section heading's that come after card links.

card-spacing-updated

.nhsapp-cards + .nhsapp-section-heading,
.nhsapp-card + .nhsapp-section-heading {
  padding-top: nhsuk-spacing(2);
}

The NHS.UK Frontend handles this is a similar way by adding top padding to headings that appear after body text and lists.

%nhsuk-body-m + %nhsuk-heading-l,
%nhsuk-body-s + %nhsuk-heading-l,
%nhsuk-list + %nhsuk-heading-l {
  @include nhsuk-responsive-padding(4, "top");
}

When card links are stacked they become a list. So when card links come before a regular heading, top padding is added to the heading.

Screenshot 2024-09-17 at 11 27 00

Bu this does not get applied to the nhsapp-section-heading because it is wrapped in a div.

@davidhunter08 davidhunter08 added awaiting triage bug Something isn't working and removed awaiting triage labels Sep 17, 2024
@davidhunter08
Copy link
Collaborator Author

davidhunter08 commented Sep 17, 2024

Another option is to increase the nhsapp-card (and nhsapp-cards) margin bottom. It's currently @include nhsuk-responsive-margin(5, "bottom"); changing it to @include nhsuk-responsive-margin(7, "bottom"); would fix the spacing.

@davidhunter08
Copy link
Collaborator Author

Another option is to increase the nhsapp-card (and nhsapp-cards) margin bottom. It's currently @include nhsuk-responsive-margin(5, "bottom"); changing it to @include nhsuk-responsive-margin(7, "bottom"); would fix the spacing.

But this option wouldn't give correct spacing next to other elements.

In the prototype I've this code that looks have solved the problem:

.nhsapp-cards + .nhsapp-section-heading,
.nhsapp-card + .nhsapp-section-heading {
  padding-top: nhsuk-spacing(3);
}

@edwardscull edwardscull linked a pull request Oct 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant