From 3855da94bdc0bcd2871ffc6637d03d9c92d165d1 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Fri, 21 Apr 2023 12:52:12 +0200 Subject: [PATCH] refactor: switched to a11y compliant HTML (#417) * refactor: switched to a11y compliant HTML * refactor: setting the aria-current on the links instead of the list items * Revert "refactor: setting the aria-current on the links" This reverts commit c2e2081f3aa1d45d45967fdfeb577c929b0d9db2. * refactor: added aria-label to button component * refactor: added SPA variant * docs: added another quick hint * chore: remove 1.6 styling tag temporarily, until we render enterprise version of the styleguide as well --- .pa11yci | 1 + .../_patterns/01-elements/buttons/button.hbs | 3 +- .../language-switcher/_language-switcher.md | 12 +++++ .../language-switcher/language-switcher.hbs | 29 ++++++++---- .../language-switcher/language-switcher.md | 1 - .../language-switcher/language-switcher.scss | 44 ++++++++++++++----- .../language-switcher~spa.json | 3 ++ .../language-switcher~spa.md | 6 +++ 8 files changed, 77 insertions(+), 22 deletions(-) create mode 100644 source/_patterns/02-components/language-switcher/_language-switcher.md create mode 100644 source/_patterns/02-components/language-switcher/language-switcher~spa.json create mode 100644 source/_patterns/02-components/language-switcher/language-switcher~spa.md diff --git a/.pa11yci b/.pa11yci index 579442afc1..b4608b1fd9 100644 --- a/.pa11yci +++ b/.pa11yci @@ -25,6 +25,7 @@ "http://127.0.0.1:8080/patterns/components-dropdown/index.html", "http://127.0.0.1:8080/patterns/components-form/index.html", "http://127.0.0.1:8080/patterns/components-overflow-menu/index.html", + "http://127.0.0.1:8080/patterns/components-language-switcher/index.html", "http://127.0.0.1:8080/patterns/components-pagination/index.html", "http://127.0.0.1:8080/patterns/components-table/index.html", "http://127.0.0.1:8080/patterns/areas-footer/index.html", diff --git a/source/_patterns/01-elements/buttons/button.hbs b/source/_patterns/01-elements/buttons/button.hbs index 5bcaebd7be..4e8f0b8e7e 100644 --- a/source/_patterns/01-elements/buttons/button.hbs +++ b/source/_patterns/01-elements/buttons/button.hbs @@ -6,6 +6,7 @@ {{#if role }} role="{{ role }}"{{/if }} {{#if disabled }} disabled{{/if }} {{#if icon}} data-icon="{{ icon }}"{{/if}} - {{#if icon-after}} data-icon-after="{{ icon-after }}"{{/if}}> + {{#if icon-after}} data-icon-after="{{ icon-after }}"{{/if}} + {{#if label}} aria-label="{{ label }}"{{/if }}> {{{ value }}} diff --git a/source/_patterns/02-components/language-switcher/_language-switcher.md b/source/_patterns/02-components/language-switcher/_language-switcher.md new file mode 100644 index 0000000000..5f5ce3a86e --- /dev/null +++ b/source/_patterns/02-components/language-switcher/_language-switcher.md @@ -0,0 +1,12 @@ +--- +title: Language switcher +state: inprogress +--- + +You could either use the language switcher component with hyperlinks, which would be the recommended way, to link to another language based page, which is addressable by a different URL. + +The other way (especially for Single Page Applications) would be to use `