Skip to content

Commit

Permalink
add secondary card links
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhunter08 committed Feb 5, 2025
1 parent b184902 commit 014aef9
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/components/card-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ If a page has a long list of card links, consider breaking them up using heading

{% example "cards/card-group-headings.njk" %}

### Secondary card links

Use secondary card links on hub pages to signpost groups of information on less important topics.

{% example "cards/card-link-secondary.njk" %}

Use them below primary card links which signpost more important information.

{% example "cards/card-link-secondary-stacked.njk" %}

## Content guidance

Aim to use active phrasing for card link text. This means starting the link text with a verb. For example: "Request repeat prescriptions" and "Check for available GP appointments". This follows content guidance on links and helps users to understand the action they can take.
Expand Down
47 changes: 47 additions & 0 deletions docs/examples/cards/card-link-secondary-stacked.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
layout: layouts/example.njk
title: Card link secondary stacked
figmaLink: ""
vueLink: ""
---

{% from "nhsapp/components/card/macro.njk" import nhsappCardGroup %}
{% from "nhsapp/components/card/macro.njk" import nhsappCard %}
{% from "nhsapp/styles/section-heading/macro.njk" import nhsappSectionHeading %}

{{ nhsappSectionHeading({
headingText: "Settings"
}) }}

{{ nhsappCardGroup({
stacked: true,
cards: [
{
title: 'Login and security',
href: '#'
},
{
title: 'Face ID',
href: '#'
}
]
}) }}

{{ nhsappSectionHeading({
headingText: "About the NHS App"
}) }}

{{ nhsappCardGroup({
stacked: true,
classes: 'nhsapp-cards--secondary',
cards: [
{
title: 'Privacy and legal policies',
href: '#'
},
{
title: 'Join our user research panel',
href: '#'
}
]
}) }}
14 changes: 14 additions & 0 deletions docs/examples/cards/card-link-secondary.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: layouts/example.njk
title: Card link secondary
figmaLink: ""
vueLink: ""
---

{% from "nhsapp/components/card/macro.njk" import nhsappCard %}

{{ nhsappCard({
title: 'Privacy and legal policies',
href: '#',
classes: 'nhsapp-card--secondary'
}) }}
6 changes: 6 additions & 0 deletions src/components/card/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ $card-border-hover-color: $color_nhsuk-grey-3;
}
}

// secondary card
.nhsapp-cards--secondary .nhsapp-card,
.nhsapp-card--secondary {
background: transparent;
}

// card group
.nhsapp-cards {
@include nhsuk-responsive-margin(5, "bottom");
Expand Down

0 comments on commit 014aef9

Please sign in to comment.