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 file download icon to de-risking guide primary nav #728

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

nateborr
Copy link
Member

@nateborr nateborr commented Sep 26, 2024

Changes proposed in this pull request:

Display an icon next to download links in the primary navigation. Currently this is used only in the de-risking guide.

Resolves #704.

Approach

When the page is at least 64em wide and the primary nav is shown in the page header, conditionally set a 1-pixel top margin on the icon in order to optically center it. This isn't necessary in narrower screens, when the primary nav moves to the Menu drop-down. This is implemented within the existing media rule for the extended header styles.

Testing

Manually test the primary nav in this PR's build.

  • Visit any page in the de-risking guide.
  • Confirm that the "Download" link shows the USWDS file download icon to its right when the viewport is...
    1. wide enough that the primary nav is shown at the top of the page
    2. narrow enough that the primary nav is shown within the "Menu" dropdown
  • Check that all primary links don't include icons, appear correctly, and work as expected.

security considerations

None. This change uses the existing framework.

@nateborr nateborr requested a review from a team as a code owner September 26, 2024 23:16
@melchoyce
Copy link
Member

Is there any way to push the icon down 1px so it looks a little more optically centered? Otherwise, LGTM 👍

@nateborr
Copy link
Member Author

I'll rework this to adjust the download icon positioning and, as part of that, make the icon handling more specific to the download link.

@nateborr nateborr marked this pull request as draft September 27, 2024 20:47
@nateborr nateborr marked this pull request as ready for review September 27, 2024 23:04
Implement and document icons for download links in primary navigation.
Currently this is used only in the de-risking guide.
@nateborr
Copy link
Member Author

@melchoyce I've updated the icon positioning per your review. It now has a 1-pixel top margin when the primary nav is displayed in the header.

Copy link
Member

@melchoyce melchoyce left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@peterrowland peterrowland left a comment

Choose a reason for hiding this comment

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

@nateborr nateborr merged commit c6b55c0 into main Sep 30, 2024
8 checks passed
@nateborr nateborr deleted the guides-704-download-icon branch September 30, 2024 17:24
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.

[Request]: Add icon next to Download link in v2 de-risking guide primary nav
3 participants