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

Add card footer link & secondary card link #238

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

davidhunter08
Copy link
Collaborator

@davidhunter08 davidhunter08 commented Jan 31, 2025

Description

  • Updated card macro for footer link variant
  • Added footer link example
  • Added placeholder card guidance page (hidden from nav until guidance ready)
Screenshot 2025-01-31 at 13 43 29

Notes

On this PR, should we also add the:

  • colour (blue) variant CSS (for the identity card)?
  • secondary card link styling?
Screenshot 2025-01-31 at 13 41 32

@davidhunter08 davidhunter08 added enhancement New feature or request component Add or improve a design component labels Jan 31, 2025
@davidhunter08
Copy link
Collaborator Author

davidhunter08 commented Feb 5, 2025

I've added styling for secondary card links and added examples to the guidance:

Screenshot 2025-02-05 at 14 28 56

cc: @Graham-Pembrey

@@ -44,14 +48,23 @@
ariaHidden: params.badgeLarge.ariaHidden
}) }}
{% endif %}
{%- if not params.readOnly -%}
{%- if params.readOnly or params.footer.href -%}
Copy link
Collaborator

Choose a reason for hiding this comment

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

The formatting might have gone weird here but I can't see what this if statement is doing? From the looks of it, it is doing if (nothing) else (chevron)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is what it is doing if (nothing) else (chevron), maybe I've galaxy brained it and there's a simpler way to do it? It basically needs to hide the chevron if the card id read only or the footer is a link.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would it be better to have a params to hide the chevron, eg: chevronHidden: true ?

@@ -20,10 +20,14 @@
{{ params.aboveContent.html | safe }}
</div>
{%- endif -%}
{%- if params.readOnly -%}
<p class="nhsapp-card__title">{{ params.title }}</p>
{%- if params.readOnly or params.footer.href -%}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again Github could of messed up formatting but why checking for footer.href here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's for if read only or a footer link (have no anchor tag) else (have anchor tag) - maybe there's a better way to achieve this?

@Graham-Pembrey
Copy link
Contributor

The guidance looks good @davidhunter08.

I'm in two minds about whether "on hub pages" is needed. On the one hand, we've only currently validated and approved of secondary card links being used on a hub page (the new account area). On the other, teams have been exploring potentially using them on error pages, and in the organ donation journey. They might have wider use?

I also wonder if we should specify what we mean by 'less important topics'. Maybe:

Use secondary card links to signpost groups of information that are less important, when you consider the user needs for the page.

@davidhunter08 davidhunter08 self-assigned this Feb 11, 2025
@davidhunter08 davidhunter08 changed the title Card footer link Add card footer link & secondary card link Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component Add or improve a design component enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants