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

Fix interaction styles for the navigation bar and the footer links #642

Merged
11 changes: 7 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@11ty/eleventy-navigation": "0.3.5",
"@11ty/eleventy-plugin-rss": "1.2.0",
"d3-selection": "3.0.0",
"eleventy-plugin-fluid": "1.0.1",
"eleventy-plugin-fluid": "1.0.2",
"eleventy-plugin-i18n-gettext": "^1.5.1",
"eleventy-plugin-pwa": "1.0.8",
"eleventy-plugin-sharp": "0.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/404.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{% set pageType = 'page--404' %}

{% block content %}
{% include 'partials/components/page-header.njk' %}
<article>
{% include 'partials/components/page-header.njk' %}
<div class="content">
<div class="wrapper">
{{ content | safe }}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/history.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{% set pageType = 'page--generic' %}

{% block content %}
{% include 'partials/components/page-header.njk' %}
<article>
{% include 'partials/components/page-header.njk' %}
<div class="content">
<div class="wrapper">
{{ content | safe }}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/home.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{% set pageType = 'page--home' %}

{% block content %}
{% include 'partials/components/page-header.njk' %}
<article>
{% include 'partials/components/page-header.njk' %}
{%- if sections %}
{%- for section in sections %}
{% include 'partials/components/section.njk' %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/ideas.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{% set pageType = 'page--ideas' %}

{% block content %}
{% include 'partials/components/page-header.njk' %}
<article>
{% include 'partials/components/page-header.njk' %}
<div class="content">
<div class="wrapper">
{% if pagination.pageNumber == 0 %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/news.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{% set pageType = 'page--news' %}

{% block content %}
{% include 'partials/components/page-header.njk' %}
<article>
{% include 'partials/components/page-header.njk' %}
<div class="content">
<div class="wrapper">
{% if posts.length %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/page--team.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{% set pageType = 'page--team' %}

{% block content %}
{% include 'partials/components/page-header.njk' %}
<article>
{% include 'partials/components/page-header.njk' %}
<div class="content">
<div class="wrapper">
<div class="people">
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{% set pageType = 'page--generic' %}

{% block content %}
{% include 'partials/components/page-header.njk' %}
<article>
{% include 'partials/components/page-header.njk' %}
{%- if sections and sections.length > 0 %}
{%- for section in sections %}
{% include 'partials/components/section.njk' %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/project.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
{% set pageType = 'page--project' %}

{% block content %}
{% include 'partials/components/page-header.njk' %}
<article>
{% set articleTitle = title %}
{% set title = projectName %}
{% include 'partials/components/page-header.njk' %}

{% set parentPages = collections.all | eleventyNavigationBreadcrumb(articleTitle) %}

Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/projects.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{% set pageType = 'page--projects' %}

{% block content %}
{% include 'partials/components/page-header.njk' %}
<article>
{% include 'partials/components/page-header.njk' %}
<div class="projects">
{% for project in collections['projects_en-CA'] %}
<article class="project">
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/layouts/resources.njk
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
</symbol>
</svg>

{% include 'partials/components/page-header.njk' %}
<article>
{% include 'partials/components/page-header.njk' %}
<div class="resources-container">
<form method="get" action="/resources/">
{% include 'partials/components/filter-resources.njk' %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/partials/components/page-header.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<header {% if locale !== 'en-CA' %} lang="en-CA" dir="ltr" {% endif %}>
<header class="page-header" {% if locale !== 'en-CA' %} lang="en-CA" dir="ltr" {% endif %}>
<div class="wrapper">
{% set breadcrumbs = [] %}
{% if eleventyNavigation.key and 'projects' not in page.url %}
Expand Down
1 change: 1 addition & 0 deletions src/assets/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'components/image',
'components/nav',
'components/nav--secondary',
'components/page-header',
'components/pagination',
'components/metadata';

Expand Down
6 changes: 5 additions & 1 deletion src/assets/styles/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ footer {
a:focus,
a:active {
outline-style: solid;
outline-width: 4px;
outline-width: 2px;
}

a:hover {
Expand Down Expand Up @@ -77,6 +77,10 @@ a[rel='external'] {
}
}

a[rel='home'] {
border-radius: 5px;
}

a[hreflang] {
font-size: var(--step-1);
font-weight: var(--fw-semibold);
Expand Down
7 changes: 5 additions & 2 deletions src/assets/styles/components/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

.nav {
height: rem(38);
margin-left: auto;
margin-top: 0;
z-index: 20;
}

.nav .menu-toggle {
Expand Down Expand Up @@ -90,6 +89,7 @@
.menu ul {
display: flex;
flex-direction: column;
gap: 2px;
list-style: none;
padding: 0;
}
Expand Down Expand Up @@ -119,6 +119,7 @@
font-weight: var(--fw-semibold);
height: rem(50);
padding: 0 var(--gutter);
position: relative;
text-align: left;
text-decoration: none;
width: 100%;
Expand All @@ -127,6 +128,8 @@
&:focus {
background: var(--fl-fgColor, var(--indigo-100));
color: var(--fl-bgColor, var(--indigo-800));
outline: var(--fl-fgColor, transparent) solid 2px;
z-index: 1;
}
}

Expand Down
50 changes: 50 additions & 0 deletions src/assets/styles/components/_page-header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.page-header {
background: var(--fl-bgColor, var(--header-bg, var(--indigo-100)));
border-bottom: rem(10) solid var(--fl-fgColor, var(--header-border));
color: var(--fl-fgColor, var(--header-fg, $black));
flex: 0 0 100%;
padding-bottom: rem(80);
padding-top: rem(80);
position: relative;

.wrapper {
margin: 0;
margin-left: 50%;
transform: translateX(-50%);
width: calc(100vw - var(--gutter));
}

.breadcrumbs {
font-family: var(--fl-font-family, var(--ff-display));
font-size: var(--step-2);
font-weight: var(--fw-semibold);
}

.intro {
font-size: var(--step--1);
margin-top: rem(20);
}
}

@include breakpoint-up(sm) {
.wrapper {
display: grid;
grid-template-columns: 2fr 1fr;
grid-template-rows: min-content min-content min-content;

h1 {
grid-column: 1 / 2;
grid-row: 2 / 3;
}
}

.breadcrumbs {
grid-column: 1 / 3;
grid-row: 1 / 2;
}

.intro {
grid-column: 1 / 2;
grid-row: 3 / 4;
}
}
25 changes: 18 additions & 7 deletions src/assets/styles/layout/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,30 @@
padding: 0 calc(var(--gutter) / 2);
}

.footer .logo {
display: flex;

a {
padding: rem(18);
}
}

.footer .logo svg {
fill: currentcolor;
width: rem(192);
}

.footer a:hover,
.footer a:focus {
background: var(--fl-linkColor, var(--indigo-500));
color: var(--fl-bgColor);
.footer a {
&:focus {
outline-color: var(--fl-linkColor, var(--yellow-500));
outline-offset: 2px;
outline-width: 2px;
}

svg {
background-color: var(--fl-linkColor);
outline: rem(5) solid var(--fl-linkColor, var(--indigo-500));
&:hover {
background: var(--fl-linkColor, var(--indigo-500));
color: var(--fl-bgColor);
outline-color: var(--fl-linkColor, var(--indigo-500));
}
}

Expand Down
12 changes: 11 additions & 1 deletion src/assets/styles/layout/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
background: var(--fl-bgColor, var(--header-bg, var(--indigo-100)));
color: var(--fl-fgColor, var(--header-fg, $black));
display: flex;
justify-content: space-between;
margin-left: auto;
margin-right: auto;
max-width: calc(var(--max-width) + var(--gutter));
padding: 0;
padding-top: 4px;
position: relative;
width: calc(100vw - var(--gutter));

Expand All @@ -29,6 +30,15 @@
}
}

.banner a {
&:hover,
&:focus {
background: var(--fl-fgColor, var(--black));
color: var(--fl-bgColor, var(--white));
outline: var(--fl-fgColor, transparent) solid 2px;
}
}

.page--home .banner {
--header-bg: var(--white);

Expand Down
45 changes: 0 additions & 45 deletions src/assets/styles/pages/_generic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,6 @@ main > article {
max-width: calc(100vw - var(--gutter));
width: calc(100vw - var(--gutter));

header {
background: var(--fl-bgColor, var(--header-bg, var(--indigo-100)));
border-bottom: rem(10) solid var(--fl-fgColor, var(--header-border));
color: var(--fl-fgColor, var(--header-fg, $black));
flex: 0 0 100%;
padding-bottom: rem(80);
padding-top: rem(80);
position: relative;

&::after {
background: inherit;
border-bottom: rem(10) solid var(--fl-fgColor, var(--header-border));
bottom: rem(-10);
content: '';
display: block;
height: calc(100% + #{rem(10)});
margin-left: 50%;
position: absolute;
transform: translateX(-50%);
width: 100vw;
z-index: -1;
}

.wrapper {
margin: 0;
}

.breadcrumbs {
font-family: var(--fl-font-family, var(--ff-display));
font-size: var(--step-2);
font-weight: var(--fw-semibold);
}

.intro {
font-size: var(--step--1);
margin-top: rem(20);
}
}

.content {
flex: 0 0 100%;
padding-bottom: rem(48);
Expand All @@ -66,12 +27,6 @@ main > article {
main > article {
max-width: calc(var(--max-width) + var(--gutter));

header {
.wrapper {
width: 50%;
}
}

.content {
flex: 0 0 calc(100% * 2 / 3);
padding-bottom: rem(96);
Expand Down