From b0339a32b86c30996f4452801f37f81274a7f512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Goetz?= Date: Sun, 22 Sep 2019 20:44:01 +0200 Subject: [PATCH] Improve accessibility and lighthouse score --- global.json | 3 ++- src/css/theme_daux/_fonts.scss | 3 +++ src/css/theme_daux_singlepage/_fonts.scss | 3 +++ src/js/theme_daux/hamburger.js | 2 ++ templates/layout/05_page.php | 4 ++-- themes/daux/css/theme-blue.min.css | 2 +- themes/daux/css/theme-blue.min.css.map | 2 +- themes/daux/css/theme-green.min.css | 2 +- themes/daux/css/theme-green.min.css.map | 2 +- themes/daux/css/theme-navy.min.css | 2 +- themes/daux/css/theme-navy.min.css.map | 2 +- themes/daux/css/theme-red.min.css | 2 +- themes/daux/css/theme-red.min.css.map | 2 +- themes/daux/js/daux.min.js | 2 +- themes/daux/js/daux.min.js.map | 2 +- themes/daux_singlepage/css/main.min.css | 2 +- themes/daux_singlepage/css/main.min.css.map | 2 +- 17 files changed, 24 insertions(+), 15 deletions(-) diff --git a/global.json b/global.json index 04d5bc8..606d4a3 100755 --- a/global.json +++ b/global.json @@ -40,7 +40,8 @@ "Edit_on": "Edit on :name:", "View_on_github": "View On GitHub", "View_documentation": "View Documentation", - "Table_of_contents": "Table of Contents" + "Table_of_contents": "Table of Contents", + "Toggle_navigation": "Toggle navigation" }, "fr": { "CodeBlocks_title": "Afficher le code", diff --git a/src/css/theme_daux/_fonts.scss b/src/css/theme_daux/_fonts.scss index eba4a7f..755d61f 100644 --- a/src/css/theme_daux/_fonts.scss +++ b/src/css/theme_daux/_fonts.scss @@ -13,6 +13,7 @@ font-family: "Roboto Slab"; font-style: normal; font-weight: 300; + font-display: fallback; src: url("../fonts/robotoslab-light.eot"); src: url("../fonts/robotoslab-light.eot?#iefix") format("embedded-opentype"), url("../fonts/robotoslab-light.woff2") format("woff2"), @@ -27,6 +28,7 @@ font-family: "Roboto Slab"; font-style: normal; font-weight: 400; + font-display: fallback; src: url("../fonts/robotoslab-regular.eot"); src: url("../fonts/robotoslab-regular.eot?#iefix") format("embedded-opentype"), @@ -42,6 +44,7 @@ font-family: "Roboto Slab"; font-style: normal; font-weight: 700; + font-display: fallback; src: url("../fonts/robotoslab-bold.eot"); src: url("../fonts/robotoslab-bold.eot?#iefix") format("embedded-opentype"), url("../fonts/robotoslab-bold.woff2") format("woff2"), diff --git a/src/css/theme_daux_singlepage/_fonts.scss b/src/css/theme_daux_singlepage/_fonts.scss index eba4a7f..755d61f 100644 --- a/src/css/theme_daux_singlepage/_fonts.scss +++ b/src/css/theme_daux_singlepage/_fonts.scss @@ -13,6 +13,7 @@ font-family: "Roboto Slab"; font-style: normal; font-weight: 300; + font-display: fallback; src: url("../fonts/robotoslab-light.eot"); src: url("../fonts/robotoslab-light.eot?#iefix") format("embedded-opentype"), url("../fonts/robotoslab-light.woff2") format("woff2"), @@ -27,6 +28,7 @@ font-family: "Roboto Slab"; font-style: normal; font-weight: 400; + font-display: fallback; src: url("../fonts/robotoslab-regular.eot"); src: url("../fonts/robotoslab-regular.eot?#iefix") format("embedded-opentype"), @@ -42,6 +44,7 @@ font-family: "Roboto Slab"; font-style: normal; font-weight: 700; + font-display: fallback; src: url("../fonts/robotoslab-bold.eot"); src: url("../fonts/robotoslab-bold.eot?#iefix") format("embedded-opentype"), url("../fonts/robotoslab-bold.woff2") format("woff2"), diff --git a/src/js/theme_daux/hamburger.js b/src/js/theme_daux/hamburger.js index 6a720ff..4d3fac0 100644 --- a/src/js/theme_daux/hamburger.js +++ b/src/js/theme_daux/hamburger.js @@ -7,7 +7,9 @@ if (trigger) { if (content.classList.contains("Collapsible__content--open")) { content.style.height = 0; content.classList.remove("Collapsible__content--open"); + trigger.setAttribute("aria-expanded", "false"); } else { + trigger.setAttribute("aria-expanded", "true"); content.style.transitionDuration = `${Math.max( content.scrollHeight, 150 diff --git a/templates/layout/05_page.php b/templates/layout/05_page.php index c1e91b5..3273e12 100755 --- a/templates/layout/05_page.php +++ b/templates/layout/05_page.php @@ -1,7 +1,7 @@ layout('theme::layout/00_layout') ?>