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

GH-84 - Modernize CSS #87

Merged
merged 29 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
652f023
feat: (WIP) modernize CSS
jobara Sep 9, 2021
58f9665
feat: (WIP) modernize CSS
jhung Sep 16, 2021
92495e6
Merge remote-tracking branch 'jhung/issue-54-modernizeCSS' into issue…
jhung Sep 17, 2021
32a6f88
feat: (WIP) modernize CSS
jhung Sep 27, 2021
5d85a07
Merge remote-tracking branch 'jobara/issue-53' into issue-54-moderniz…
jhung Sep 27, 2021
0d9feaa
feat: (WIP) modernize CSS
jhung Sep 29, 2021
5639001
feat: use disclosure widget for language selection
jobara Sep 30, 2021
5713ff8
feat: use disclosure widget for mobile nav menu
jobara Sep 30, 2021
0dfea27
refactor: cleanup of menu code
jobara Sep 30, 2021
70d6e21
Merge remote-tracking branch 'jobara/gh-81' into gh-84
jhung Oct 1, 2021
1ce242c
fix: menu name collision
jobara Oct 4, 2021
2195b6e
feat:(WIP) modernize CSS
jhung Oct 4, 2021
acfa23f
Merge remote-tracking branch 'origin/main' into gh-84
jhung Oct 8, 2021
0d6f2da
feat: navigation and language menus
jhung Oct 14, 2021
d4b274f
feat: clean-up linting and optimization
jhung Oct 15, 2021
2225dc4
fix: UIO contrast themes and netlify linking error
jhung Oct 15, 2021
55a923d
fix: menu positions, contrast styles, and skip link visibility
jhung Oct 19, 2021
4bbaeda
fix: removed broken link to normalize.css
jhung Oct 19, 2021
94707fa
fix: close menu with touch interaction outside of menu
jobara Oct 20, 2021
aff9690
fix: header and menu contrast styles
jhung Oct 20, 2021
94c8d76
Merge remote-tracking branch 'jobara/GH-81' into gh-84
jhung Oct 20, 2021
ad12664
fix: menu position and contrast styles
jhung Oct 22, 2021
c4d1965
feat: table of contents styling, cleanup, and icon license
jhung Oct 28, 2021
1f53d10
chore: added license information for Octocat logo
jhung Nov 1, 2021
81ffe73
fix: set Table of Contents to initially hidden for UIO to toggle
jhung Nov 8, 2021
b63856d
fix: link focus styling issues and postcss version
jhung Nov 9, 2021
5c32a16
fix: focus styling with UIO
jhung Nov 11, 2021
88453c0
Fix: menu close behaviour for iOS and MacOS
jhung Nov 16, 2021
c89ff0a
fix: focus styling
jhung Nov 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function (config) {
});

// Shortcodes
config.addPairedShortcode("unmarkedList", (content) => wrap(content, "idg-unmarkedList"));
config.addPairedShortcode("unmarkedList", (content) => wrap(content, "list-articles"));
config.addShortcode("svg_sprite", function (sprite) {
return `<svg class="idg-${sprite}" aria-hidden="true"><use xlink:href="/assets/images/sprites.svg#${sprite}"></use></svg>`;
});
Expand Down
55,307 changes: 38,222 additions & 17,085 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
"dependencies": {
"@11ty/eleventy": "0.12.1",
"@11ty/eleventy-navigation": "0.3.2",
"docs-core": "fluid-project/docs-core",
"eleventy-plugin-fluid": "0.3.1",
"infusion": "4.0.0-dev.20210622T193827Z.ac6adb829.FLUID-6629",
"jquery-ui": "1.12.1"
"infusion": "4.0.0-dev.20210622T193827Z.ac6adb829.FLUID-6629"
},
"devDependencies": {
"@commitlint/cli": "13.1.0",
Expand All @@ -48,11 +46,7 @@
"postcss": "^8.3.6",
Copy link
Member

Choose a reason for hiding this comment

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

Could you pin this to a specific version?

Copy link
Member Author

Choose a reason for hiding this comment

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

What version should be used?

"resolve-url-loader": "4.0.0",
"rimraf": "3.0.2",
"sass": "1.37.5",
"sass-loader": "12.1.0",
"slugify": "1.6.0",
"stylus": "0.54.8",
"stylus-loader": "3.0.2",
"vue-template-compiler": "2.6.14"
}
}
25 changes: 8 additions & 17 deletions src/_includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@
<head>
{% include "partials/head-matter.njk" %}
</head>
<body class="docs-template idg {% if bodyClass %}{{ bodyClass }}{% endif %}">

<div class="container docs-template-container">

{% include "partials/header.njk" %}

<div class="docs-template-articleBody">

<article id="content" class="small-12">
{% block content %}{% endblock %}
</article>

</div>

{% include "partials/footer.njk" %}

</div> <!-- end container -->
<body>
{% include "partials/header.njk" %}
<main id="content">
<article>
{% block content %}{% endblock %}
</article>
jhung marked this conversation as resolved.
Show resolved Hide resolved
</main>
{% include "partials/footer.njk" %}
{% uioInit config.languages[locale].uioSlug, langDir %}
</body>
</html>
46 changes: 0 additions & 46 deletions src/_includes/layouts/category.njk

This file was deleted.

10 changes: 5 additions & 5 deletions src/_includes/layouts/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
{% endset %}

{% block content %}

<h1>{{ title }}</h1>
{% include "partials/content.njk" %}
{% include "partials/editOnGitHub.njk" %}

<div class="wrapper wrapper__article">
<h1>{{ title }}</h1>
{% include "partials/content.njk" %}
{% include "partials/editOnGitHub.njk" %}
</div>
{% endblock %}
50 changes: 50 additions & 0 deletions src/_includes/layouts/page.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{% extends "layouts/base.njk" %}

{% set bodyClass = "idg-category-" + category %}

{% set editLinkPath %}
{{ page.filePathStem}}.md
{% endset %}

{% set navPages = collections[category + "_" + locale] | eleventyNavigationBreadcrumb(eleventyNavigation.key) %}

{% block content %}

<header class="article-header {{ category | lower }}-bg fl-inverted-color">
<div class="wrapper">
<nav aria-label="{{ _("Breadcrumb") }}">
<ul class="breadcrumbs inline-list">
<li>
<a href="/{% if not (locale === config.defaultLanguage) %}{{ config.languages[locale].slug }}{% endif %}">
{{ _("Home") }}
</a>
</li>
{% for page in navPages %}
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
<li aria-current="page">{{ eleventyNavigation.title }}</li>
</ul>
</nav>
<h1 class="article-title">{{ title }}</h1>
</div>
</header>

<div class="wrapper wrapper__article">
{% include "partials/content.njk" %}

{% if not navPages.length %}
{# If displaying a listing page of articles #}
{% set childPages = collections[category + "_" + locale] | eleventyNavigation(eleventyNavigation.key) %}
<nav class="list-articles__contents" aria-label="{{ _i("${categoryName} contents", {categoryName: eleventyNavigation.key}) }}">
<ul>
{# Output page links in alphabetical order #}
{% for page in childPages |sort(false, true, "title") %}
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
</ul>
</nav>
{% else %}
{% include "partials/editOnGitHub.njk" %}
{% endif %}
</div>
{% endblock %}
6 changes: 2 additions & 4 deletions src/_includes/partials/content.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<div class="flc-toc-tocContainer docs-template-uio-toc"></div>
<div class="flc-toc-tocContainer"></div>

<div class="docs-template-articleContent">
{{ content | safe }}
</div>
{{ content | safe }}
4 changes: 2 additions & 2 deletions src/_includes/partials/editOnGitHub.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p class="docs-template-githubLink">
<p class="githubLink">
<a href="https://github.com/inclusive-design/guide.inclusivedesign.ca/edit/main/src{{ editLinkPath }}" rel="nofollow" target="_blank" class="link-external">
{{ _("Edit this Page on GitHub") }}
{% svg_sprite "logo-github" %}{{ _("Edit this Page on GitHub") }}
</a>
</p>
48 changes: 24 additions & 24 deletions src/_includes/partials/footer.njk
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<footer class="row docs-template-footer fl-inverted-color">
<p>
{% set footer_community %}<a href='https://wiki.fluidproject.org/display/fluid/The+Inclusive+Design+Guide' rel='nofollow' target='_blank'>{{ _("community members") }}</a>{% endset %}
{% set footer_org %}</br><a href='{{ _(site.orgURL) }}' rel='nofollow' target='_blank'>{{ _(site.org) }}</a>{% endset %}
{% set footer_institute %}<a href='{{ _(site.instituteURL) }}' target='_blank'>{{ _(site.institute) }}</a>{% endset %}
{{ _i("Created by the ${community} of the ${org} at ${institute}, and supported by", {
community: footer_community,
org: footer_org,
institute: footer_institute
}) | safe }}
</p>
<footer class="header-footer-bg header-footer-color fl-inverted-color">
<div class="wrapper wrapper_site_footer">
<p>
{% set footer_community %}<a href='https://wiki.fluidproject.org/display/fluid/The+Inclusive+Design+Guide' rel='nofollow' target='_blank'>{{ _("community members") }}</a>{% endset %}
{% set footer_org %}</br><a href='{{ _(site.orgURL) }}' rel='nofollow' target='_blank'>{{ _(site.org) }}</a>{% endset %}
{% set footer_institute %}<a href='{{ _(site.instituteURL) }}' target='_blank'>{{ _(site.institute) }}</a>{% endset %}
{{ _i("Created by the ${community} of the ${org} at ${institute}, and supported by", {
community: footer_community,
org: footer_org,
institute: footer_institute
}) | safe }}
</p>
<p>
<a class="footer__logo-links" aria-label="FLOE Project" href="http://www.floeproject.org/" target="_blank">{% svg_sprite "logo-floe" %}</a>
<a class="footer__logo-links" aria-label="Prosperity for All" href="http://www.prosperity4all.eu/" target="_blank">{% svg_sprite 'logo-p4a' %}</a><br/>
</p>
<p>
{{ _i("Hosted with ${netlify}.", {netlify: "<a href='https://netlify.com/'>Netlify</a>"}) | safe }}
</p>

<p>
<a class="footer-logo-links" aria-label="FLOE Project" href="http://www.floeproject.org/" target="_blank">{% svg_sprite "logo-floe" %}</a>
<a class="footer-logo-links" aria-label="Prosperity for All" href="http://www.prosperity4all.eu/" target="_blank">{% svg_sprite "logo-p4a" %}</a><br/>
</p>

<p>
{{ _i("Hosted with ${netlify}.", {netlify: "<a href='https://netlify.com/'>Netlify</a>"}) | safe }}
</p>

<p>
{% set license %}<a rel='license' href='{{ _(site.licenseURL) }}'>{{ _(site.license) }}</a>{% endset %}
{{ _i("This documentation is licensed under a ${license}.", {license: license}) | safe }}
</p>
<p>
{% set license %}<a rel='license' href='{{ _(site.licenseURL) }}'>{{ _(site.license) }}</a>{% endset %}
{{ _i("This documentation is licensed under a ${license}.", {license: license}) | safe }}
</p>
</div>
</footer>
7 changes: 0 additions & 7 deletions src/_includes/partials/head-matter.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@
<title>{{ title }} | {{ _(site.title) }} {% gettext_var locale, site.title %}</title>
<link rel="icon" type="image/png" href="/assets/images/favico.png">

<link rel="stylesheet" href="/assets/styles/normalize.css">
<link rel="stylesheet" href="/assets/styles/foundation.min.css">
<link rel="stylesheet" href="/lib/jquery-ui/themes/base/core.css">
<link rel="stylesheet" href="/lib/jquery-ui/themes/base/menu.css">
<link rel="stylesheet" href="/lib/jquery-ui/themes/base/theme.css">

{% uioStyles %}
<link rel="stylesheet" href="/assets{{ assets['/styles/app.css'] }}">

{% uioScripts %}
<script src="/lib/jquery-ui/ui/widgets/menu.js"></script>
<script defer src="/assets{{ assets['/scripts/app.js'] }}"></script>
<script defer src="/assets{{ assets['/scripts/matomo.js'] }}"></script>
42 changes: 16 additions & 26 deletions src/_includes/partials/header.njk
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
<!-- Skip Link -->
<nav id="skip" class="fl-inverted-color">
<a href="#content" class="docs-template-skip-content">{{ _("Skip to Content") }}</a>
<nav class="fl-inverted-color">
Copy link
Member

Choose a reason for hiding this comment

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

should we add an aria-label to this? Perhaps also "Skip to Content"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it's necessary since the link is descriptive enough.

<a id="skip-to-content" href="#content">{{ _("Skip to Content") }}</a>
</nav>
<!-- END skip link -->

<header class="ignore-for-TOC row fl-inverted-color">
<header class="ignore-for-TOC site-header header-footer-bg header-footer-color fl-inverted-color">
{% include "partials/uio.njk" %}

{% localeLink locale, translationKey, category, collections %}
<div class="menus">
{% include 'partials/language.njk' %}
{% include 'partials/nav-mobile.njk' %}
</div>

<div class="small-12 column docs-template-header">
<a class="" href="/{% if not (locale === config.defaultLanguage) %}{{ config.languages[locale].slug }}{% endif %}" title="{{ _i("Home: ${siteName}", {siteName: _(site.title)}) }}">
{% svg_sprite "logo-idrc" %}
<h1>{{ _(site.title) }}</h1>
<div class="wrapper">
<a class="banner" href="/{% if not (locale === config.defaultLanguage) %}{{ config.languages[locale].slug }}{% endif %}" title="{{ _i("Home: ${siteName}", {siteName: _(site.title)}) }}">
<span class="banner-logo">
{% svg_sprite "logo-idrc" %}
</span>
<h1 class="banner-heading">{{ _(site.title) }}</h1>
</a>

<!-- Mobile Menu -->
<nav class="right show-for-small-only docs-template-nav-mobile">
<ul id="menu">
<li class="docs-template-dropDown-header"><span class="docs-template-nav-mobile-icon"></span>
<ul class="docs-template-dropDown">
{% include "partials/menu.njk" %}
</ul>
</li>
</ul>
</nav>
</div>
{% include 'partials/nav-desktop.njk' %}

<!-- "Desktop" Menu -->
<div class="docs-template-header">
<nav class="idg-tabs small-12 column show-for-medium-up">
<ul class="inline-list">
{% include "partials/menu.njk" %}
</ul>
</nav>
</div>


</header>
9 changes: 9 additions & 0 deletions src/_includes/partials/language.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<nav class="idg-language-picker menu" aria-labelledBy="idg-language-button">
<button id="idg-language-button" class="disclosure-button" aria-expanded="false" aria-controls="idg-language-list">
{% svg_sprite "icon-language" %}
{{ _("Language") }}
</button>
<ul id="idg-language-list" class="menu-list">
{% localeLink locale, translationKey, category, collections %}
</ul>
</nav>
6 changes: 3 additions & 3 deletions src/_includes/partials/menu.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
{% set slug = item.key | lower %}
{% if item.locale === locale %}
{% set inCategory = item.key === category %}
<li class="idg-nav{{ item.key }}{% if inCategory %} docs-template-category-active{% endif %}">
<a href="{{ item.url }}"{% if inCategory %} aria-current="page"{% endif %}>
{% svg_sprite "icon-" + slug %} {{ item.title }}
<li>
<a href="{{ item.url }}" class="{{ item.key | lower }}-bg" {% if inCategory %} aria-current="page"{% endif %}>
{% svg_sprite "icon-" + slug %}{{ item.title }}
</a>
</li>
{% endif %}
Expand Down
5 changes: 5 additions & 0 deletions src/_includes/partials/nav-desktop.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<nav class="nav nav-desktop" aria-label="menu">
<ul class="inline-list nav-list nav-list__desktop">
{% include "partials/menu.njk" %}
</ul>
</nav>
9 changes: 9 additions & 0 deletions src/_includes/partials/nav-mobile.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<nav class="idg-menu-nav menu" aria-labelledBy="idg-menu-nav-button">
<button id="idg-menu-nav-button" class="disclosure-button" aria-expanded="false" aria-controls="idg-nav-menu-list">
{% svg_sprite "icon-menu" %}
{{ _("Menu") }}
</button>
<ul id="idg-menu-nav-list" class="menu-list">
{% include "partials/menu.njk" %}
</ul>
</nav>
2 changes: 1 addition & 1 deletion src/_includes/partials/uio.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="fl-panelBar fl-panelBar-wideScreen">
<span class="fl-prefsEditor-buttons">
<button class="flc-slidingPanel-toggleButton fl-prefsEditor-showHide"> Show/Hide</button>
<button class="flc-prefsEditor-reset fl-prefsEditor-reset"><span class="fl-icon-undo"></span> {{ _("Reset") }}</button>
<button class="flc-prefsEditor-reset fl-prefsEditor-reset"><span class="fl-icon-undo"></span> {{ _("Reset") }}</button>
</span>
</div>
</div>
Binary file removed src/assets/fonts/floe-logo.eot
Binary file not shown.
Binary file removed src/assets/fonts/floe-logo.ttf
Binary file not shown.
Binary file removed src/assets/fonts/github-1.eot
Binary file not shown.
11 changes: 0 additions & 11 deletions src/assets/fonts/github-1.svg

This file was deleted.

Binary file removed src/assets/fonts/github-1.ttf
Binary file not shown.
Binary file removed src/assets/fonts/github-1.woff
Binary file not shown.
Binary file removed src/assets/fonts/logo.eot
Binary file not shown.
Binary file removed src/assets/fonts/logo.ttf
Binary file not shown.
Loading