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
1 change: 1 addition & 0 deletions src/_includes/svg/icon-download.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 41 additions & 26 deletions src/assets/styles/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,53 @@ a {
text-decoration: underline;
}

a:hover,
a:focus {
background: var(--fl-linkColor, var(--accent, var(--yellow-500)));
color: var(--fl-bgColor, currentColor);
outline: none;
main,
footer {
a {
border-radius: 5px;
}

a:hover,
a:focus,
a:active {
outline-style: solid;
outline-width: 4px;
}

a:hover {
background: var(--fl-linkColor, var(--accent, var(--yellow-500)));
color: var(--fl-bgColor, currentColor);
outline-color: var(--fl-linkColor, var(--accent, var(--yellow-500)));
}

a:focus {
outline-color: var(--fl-linkColor, var(--indigo-800));
outline-offset: 2px;
outline-width: 2px;
}

a:active {
background: var(--fl-linkColor, var(--indigo-800));
color: var(--fl-bgColor, var(--white));
outline-color: var(--fl-linkColor, var(--indigo-800));
}
}

a[hreflang],
a[download],
a[rel='external'] {
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!

width: 1em;
}
}

a[hreflang] {
align-items: center;
display: inline-flex;
font-size: var(--step-1);
font-weight: var(--fw-semibold);
margin-top: var(--step-2);

svg {
display: block;
margin-right: 0.5em;
width: var(--step-1);
}
}

.content a:visited {
Expand All @@ -69,19 +97,6 @@ main h4,
mask-size: 1.5em;
padding-left: 1em;
}

a[rel~='external']::after,
a[href^='mailto:']::after {
background-color: currentcolor;
content: '';
margin-bottom: rem(-4);
margin-left: rem(4);
mask-image: url('../images/external.svg');
mask-position: center;
mask-repeat: no-repeat;
mask-size: 1.5em;
padding-left: 1em;
}
}

blockquote {
Expand Down
5 changes: 5 additions & 0 deletions src/assets/styles/base/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ h4 + *,
margin-top: rem(30);
}

* + h5,
* + .h5 {
margin-top: var(--step-2);
}

@include breakpoint-up(md) {
:root {
--step-1: calc(22 / 16 * 1rem);
Expand Down
5 changes: 4 additions & 1 deletion src/assets/styles/components/_nav--secondary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
.menu--secondary a {
align-items: center;
border-bottom: rem(1) solid var(--fl-linkColor, var(--black));
border-radius: 0;
display: block;
display: flex;
flex-direction: row;
Expand All @@ -30,14 +31,16 @@
calc(-1 * var(--gutter)) rem(-1) 0 rem(1) var(--fl-linkColor, var(--indigo-800)),
var(--gutter) rem(-1) 0 rem(1) var(--fl-linkColor, var(--indigo-800));
color: var(--fl-bgColor, var(--white));
outline: transparent;
}

&:active {
background: var(--fl-linkColor, var(--indigo-500));
box-shadow:
calc(-1 * var(--gutter)) rem(-1) 0 rem(1) var(--fl-linkColor, var(--indigo-500)),
var(--gutter) rem(-1) 0 rem(1) var(--fl-linkColor, var(--indigo-500));
color: var(--fl-bgColor);
color: var(--fl-bgColor, var(--white));
outline: transparent;
}

&::after {
Expand Down
1 change: 1 addition & 0 deletions src/assets/styles/pages/_generic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ main > article {
}
}

hr,
.hr {
border-bottom: rem(2) solid;
display: block;
Expand Down
4 changes: 4 additions & 0 deletions src/assets/styles/pages/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
}
}

#what-is-inclusive-design + * {
z-index: 1;
}

.page--home .entry + .entry {
margin-top: rem(24);
}
Expand Down
2 changes: 1 addition & 1 deletion src/projects/en-CA/communication-access-reports.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parentTitle: Communication Access within the Accessible Canada Act

[Part One: Framing Communication Accessibility in the Canadian Context](/media/commacc-part-1_framing-report_en.docx)

[](/media/commacc-part-1_framing-report_en.docx)[Part Two: Scope of Communication Access Approaches and Supports for in Federally Regulated Contexts](/media/commacc-part-2_scoping-report_en.docx)
[Part Two: Scope of Communication Access Approaches and Supports for in Federally Regulated Contexts](/media/commacc-part-2_scoping-report_en.docx)

[Part Three: Recommendations for Improving Communication Access in Federally Regulated Contexts](/media/commacc-part-3_recommendations_en.docx)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Global and national scan of existing data and research related to incidence and

[Part One: Framing Communication Accessibility in the Canadian Context](/media/commacc-part-1_framing-report_en.docx)

[](/media/commacc-part-1_framing-report_en.docx)[Part Two: Scope of Communication Access Approaches and Supports for in Federally Regulated Contexts](/media/commacc-part-2_scoping-report_en.docx)
[Part Two: Scope of Communication Access Approaches and Supports for in Federally Regulated Contexts](/media/commacc-part-2_scoping-report_en.docx)

[Part Three: Recommendations for Improving Communication Access in Federally Regulated Contexts](/media/commacc-part-3_recommendations_en.docx)

Expand Down Expand Up @@ -154,8 +154,6 @@ Ali Kazmi is a research assistant for OCAD’s Inclusive Design Research Centre.

Shalaine Sedres is a graduate student pursuing a Master’s degree at the University of Toronto’s Rehabilitation Science Institute. She obtained her Bachelor’s degree in Community Rehabilitation and Disability Studies from the University of Calgary. As a research assistant, Shalaine has made valuable contributions to the Inclusive Design Research Centre’s Equitable Digital Systems project by facilitating co-design sessions and interpreting insights. Her current research focuses on leveraging accessible playgrounds by incorporating rehabilitation and educational programming. She is dedicated to promoting inclusivity and reducing barriers that hinder the full participation of children with disabilities.

[](src/media/commacc-part-3_recommendations_fr.docx)

![communication access symbol](/media/commaccsymbol.png)

[Learn about the communication access symbol (c)](https://www.cdacanada.com/resources/accessible-businesses-and-services/communication-access-symbol/)
Expand Down
20 changes: 8 additions & 12 deletions src/projects/en-CA/future-of-work-equitable-digital-systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Our first co-design captured moments (vignettes) that illustrate some of the exp

{% endimagePositionWithText %}

#### [](/media/experience.docx)Download Samples from Co-design 1
#### Download Samples from Co-design 1

[Experiences with Technology in English](/media/experience.docx)

Expand All @@ -61,13 +61,13 @@ The second and fourth EDS co-designs brought contributors together to create "St

<https://youtu.be/w_7nyT_EXlo>

<iframe width="560" height="315" src="https://www.youtube.com/embed/EVuTl2PG0O8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/w_7nyT_EXlo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

#### Jessica looks for Job

https://www.youtube.com/watch?v=EVuTl2PG0O8[](https://www.youtube.com/watch?v=EVuTl2PG0O8)
<https://www.youtube.com/watch?v=EVuTl2PG0O8>

<iframe width="560" height="315" src="https://www.youtube.com/embed/w_7nyT_EXlo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/EVuTl2PG0O8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

#### Friendship Chronicle

Expand Down Expand Up @@ -122,9 +122,7 @@ For another co-design set, teams of co-designers wrote letters to technology. Th
>
> *I have many hopes for our future together. I want to reach higher in my professional life and find a position where I can fully utilize my talents, skills and experience, with fewer communication barriers than ever before. I want to participate more fully in my community. I want to show the world that deaf, hard of hearing and deaf-blind people are everywhere, we are competent and capable, and we deserve the same access and opportunities as everyone else. My hope is that you continually improve yourself so that you can help me and others with hearing loss connect with anyone, anywhere. Zoom Live Transcription, I adore you!*

[](/media/the-letters.docx)

#### [](/media/the-letters.docx)Break-up Letter
#### Break-up Letter

> *Dear Zoom Live Transcription,*
>
Expand All @@ -144,7 +142,7 @@ For another co-design set, teams of co-designers wrote letters to technology. Th
>
> *Regretfully,*

#### [](/media/the-letters.docx)Compromise Letter
#### Compromise Letter

> *Dear Zoom, Live Transcription,*
>
Expand All @@ -158,14 +156,12 @@ For another co-design set, teams of co-designers wrote letters to technology. Th
>
> *With love and gratitude,*

### [](/media/the-letters.docx)Download all of the Letters
### Download all of the Letters

[Letters to Technology in English](/media/the-letters.docx)

[Lettres à la technologie en français](/media/les_lettres.docx)

[](/media/experience.docx)

## Partners

![Logos for each of the partners listed below who contributed to the project.](/media/partners_eds.png)
Expand Down Expand Up @@ -274,4 +270,4 @@ Cheryl Zinyk

This project was funded by **Accessibility Standards Canada**

![The logo of the Government of Canada.](/media/canada.png)
![The logo of the Government of Canada.](/media/canada.png)
2 changes: 1 addition & 1 deletion src/projects/en-CA/odd.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ IDRC with the support of Kessler Foundation and Microsoft has launched ODD (Opti

## About

In the work with did in our [We Count project ](https://wecount.inclusivedesign.ca/)and [Future of Work and Disability project](https://wecount.inclusivedesign.ca/views/fwd/) we noticed that AI hiring tools were filtering out highly qualified candidates with disabilities. It is estimated that over 50% of companies will deploy some form of AI assisted or AI automated hiring tools in the next decade (Sage, Pego). We knew that AI hiring tools exploit data regarding past hiring to filter applicants by optimizing the characteristics of past successes. In optimizing past successes these tools are biased against diversification; while the companies deploying them have a commitment to diversity, equity, and inclusion. AI hiring tool options such as specifying “culture fit,” persona matching, team profiles, and favourite university, contribute toward creating a company monoculture. This is not good for company survival. It also filters out applicants with disabilities. Promising research has shown that algorithms that favour data exploration rather than data exploitation result in greater hiring diversity without compromising hiring success [](<(https://www.nber.org/papers/w27736>)([Hiring as Exploration](https://www.nber.org/papers/w27736)). This prior research focuses on race, origin, and gender diversity. ODD will extend this research to the more difficult area of disability. Unlike race, origin, and gender; disability has no common data characteristic other than distance from the average so that things made for the mainstream don’t work for you.
In the work with did in our [We Count project ](https://wecount.inclusivedesign.ca/)and [Future of Work and Disability project](https://wecount.inclusivedesign.ca/views/fwd/) we noticed that AI hiring tools were filtering out highly qualified candidates with disabilities. It is estimated that over 50% of companies will deploy some form of AI assisted or AI automated hiring tools in the next decade (Sage, Pego). We knew that AI hiring tools exploit data regarding past hiring to filter applicants by optimizing the characteristics of past successes. In optimizing past successes these tools are biased against diversification; while the companies deploying them have a commitment to diversity, equity, and inclusion. AI hiring tool options such as specifying “culture fit,” persona matching, team profiles, and favourite university, contribute toward creating a company monoculture. This is not good for company survival. It also filters out applicants with disabilities. Promising research has shown that algorithms that favour data exploration rather than data exploitation result in greater hiring diversity without compromising hiring success ([Hiring as Exploration](https://www.nber.org/papers/w27736)). This prior research focuses on race, origin, and gender diversity. ODD will extend this research to the more difficult area of disability. Unlike race, origin, and gender; disability has no common data characteristic other than distance from the average so that things made for the mainstream don’t work for you.

#### Why ODD?

Expand Down
12 changes: 11 additions & 1 deletion src/transforms/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ module.exports = (value, outputPath) => {
for (const link of links) {
if (
!link.href.startsWith('/') &&
(!['localhost:3000', 'idrc.ocadu.ca'].includes(link.host) || !link.host.endsWith('idrc.netlify.app'))
(!['localhost:3000', 'localhost:8080', 'idrc.ocadu.ca'].includes(link.host) || !link.host.endsWith('idrc.netlify.app'))
) {
link.setAttribute('rel', 'external');
if (!link.closest('nav') && link.className !== 'project__link') {
link.innerHTML = `${link.innerHTML}<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" role="presentation" aria-hidden="true"><path d="M13.4444 8.77778V13.4444C13.4444 13.857 13.2806 14.2527 12.9888 14.5444C12.6971 14.8361 12.3014 15 11.8889 15H2.55556C2.143 15 1.74733 14.8361 1.45561 14.5444C1.16389 14.2527 1 13.857 1 13.4444V4.11111C1 3.69855 1.16389 3.30289 1.45561 3.01117C1.74733 2.71944 2.143 2.55556 2.55556 2.55556H7.22222V4.11111H2.55556V13.4444H11.8889V8.77778H13.4444ZM8.77778 1V2.55556H12.3447L6.28344 8.61678L7.38322 9.71656L13.4444 3.65533V7.22222H15V1H8.77778Z" fill="currentColor"/></svg>`;
}
}

if (
link.href.endsWith('.docx') || link.href.endsWith('.pdf')
) {
link.setAttribute('download', '');
link.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" role="presentation" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M1 11.5v1.75A1.75 1.75 0 0 0 2.75 15h10.5A1.75 1.75 0 0 0 15 13.25V11.5M11.5 8 8 11.5m0 0L4.5 8M8 11.5V1"/></svg>${link.innerHTML}`;
}
}
}
Expand Down