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

feat: add external and download icons to links automatically #639

Merged
merged 12 commits into from
Jun 22, 2023

Conversation

greatislander
Copy link
Member

@greatislander greatislander commented Jun 20, 2023

  • This pull request has been tested by running npm run test without errors
  • This pull request has been built by running npm run build without errors
  • This isn't a duplicate of an existing pull request

Description

Adds download and external link icons automatically.

Steps to test

  1. Visit projects page and explore a project, e.g. "Communications Access".

Expected behavior: Links to downloadable files are preceded by download icons, and links to external pages are followed by external link icons.

Additional information

Not applicable.

Related issues

Not applicable.

@netlify
Copy link

netlify bot commented Jun 20, 2023

Deploy Preview for idrc ready!

Name Link
🔨 Latest commit 2ce8e26
🔍 Latest deploy log https://app.netlify.com/sites/idrc/deploys/64933db5fae0670008be3817
😎 Deploy Preview https://deploy-preview-639--idrc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@greatislander greatislander self-assigned this Jun 20, 2023
@greatislander greatislander added the enhancement New feature or request label Jun 20, 2023
@greatislander greatislander marked this pull request as ready for review June 20, 2023 20:16
@chosww
Copy link
Contributor

chosww commented Jun 21, 2023

Thanks Ned, this looks great. I found an issue with Communications Access project, where there was an extra link that caused the download icon to appear twice, so I made fix in my branch: https://github.com/chosww/idrc/tree/feat/link-styling-improvements.

svg {
display: inline-block;
margin-left: 0.25em;
margin-right: 0.25em;
Copy link
Contributor

Choose a reason for hiding this comment

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

With updated focus style, it looks little off to have margin on the svg:

Screen Shot 2023-06-21 at 1 24 03 PM

As shown in the image, the link has no space to the left but has some space to the right because of the margin. I am thinking, could we remove the margin on SVG, and make the wrapper to handle the gap? Here's an example:

a[rel='external'] {
  display: inline-flex;
  flex-direction: row;
  gap: 0.1rem;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good call, @chosww — I will try that. Thanks!

@chosww
Copy link
Contributor

chosww commented Jun 21, 2023

I noticed that we need to apply updated focus/hover style to the IDRC logo on the footer as well.

@chosww
Copy link
Contributor

chosww commented Jun 21, 2023

I noticed that we need to apply updated focus/hover style to the IDRC logo on the footer as well.

Actually, now I wonder. Was the style changes in the footer intended for the scope of this work? I found some focus style issue for the nav bar, so I am going to open a new issue for that and maybe we can include footer focus/hover work with the new issue. I approve the changes you made for the external link and download icons.

@greatislander greatislander merged commit f87ffc5 into dev Jun 22, 2023
7 checks passed
@greatislander greatislander deleted the feat/link-styling-improvements branch June 22, 2023 13:15
@greatislander greatislander modified the milestone: 2.0.0 Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants