From dbbdcac6e81c88baf5296addd2ec5f5496db83cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 23 Jun 2025 19:45:05 +0200 Subject: [PATCH] feat: a11y improvements --- .../Private/Assets/scss/_iconbar.scss | 3 + .../Assets/js/controllers/nav_controller.js | 32 ++++++++ .../Assets/scss/base/_rte-content.scss | 6 +- .../Assets/scss/components/_buttons.scss | 78 +++++++++++-------- .../Assets/scss/components/_contact-bar.scss | 2 +- .../Assets/scss/components/_forms.scss | 4 +- .../Resources/Private/Partials/Badge.html | 4 +- .../Private/Partials/City/Teaser.html | 2 +- .../Private/Partials/ContactBar.html | 18 ++++- .../Resources/Private/Partials/Footer.html | 2 +- .../Private/Partials/HeaderSlider.html | 2 +- .../Private/Partials/Hotel/Teaser.html | 6 +- .../Resources/Private/Partials/Mainnav.html | 15 +++- .../Private/Partials/Product/Teaser.html | 6 +- .../Private/Partials/Region/Teaser.html | 2 +- .../Private/Partials/Search/FilterPanel.html | 36 +++++---- .../Private/Partials/Search/Result.html | 24 +++--- .../Private/Partials/Teaser/OneColumn.html | 6 +- .../Private/Partials/Textmedia/LinkPanel.html | 30 +++---- .../Resources/Private/Partials/Topnav.html | 4 +- .../FluidStyledContent/TeaserCountry.html | 22 +++--- .../Private/Templates/Region/Detail.html | 2 +- .../Templates/Search/Searchresult.html | 2 +- .../Private/Templates/Searchbar/Index.html | 2 +- tailwind.config.js | 4 +- 25 files changed, 197 insertions(+), 117 deletions(-) create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/nav_controller.js diff --git a/public/typo3conf/ext/ep_events/Resources/Private/Assets/scss/_iconbar.scss b/public/typo3conf/ext/ep_events/Resources/Private/Assets/scss/_iconbar.scss index 99ba3656..85c51543 100644 --- a/public/typo3conf/ext/ep_events/Resources/Private/Assets/scss/_iconbar.scss +++ b/public/typo3conf/ext/ep_events/Resources/Private/Assets/scss/_iconbar.scss @@ -1,3 +1,6 @@ +.iconbar { + @apply hidden lg:block fixed z-100 top-[30vh] right-0 overflow-hidden; +} .iconbar { display: none; @include mq($from: desktop) { diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/nav_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/nav_controller.js new file mode 100644 index 00000000..fc2e5171 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/nav_controller.js @@ -0,0 +1,32 @@ +import { Controller } from '@hotwired/stimulus' +import { useClickOutside } from 'stimulus-use' + +export default class extends Controller { + + static classes = ['hidden'] + static targets = ['button', 'subnav'] + static values = { expanded: Boolean } + + connect() { + useClickOutside(this) + } + + toggle(e) { + e.preventDefault() + this.expandedValue = !this.expandedValue + } + + clickOutside(e) { + this.expandedValue = false + } + + expandedValueChanged(expanded) { + this.buttonTarget.setAttribute('aria-expanded', expanded) + this.subnavTarget.setAttribute('aria-hidden', !expanded) + if (true === expanded) { + this.subnavTarget.classList.remove(...this.hiddenClasses) + } else { + this.subnavTarget.classList.add(...this.hiddenClasses) + } + } +} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/base/_rte-content.scss b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/base/_rte-content.scss index 35521ede..d220390b 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/base/_rte-content.scss +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/base/_rte-content.scss @@ -32,7 +32,7 @@ a:not(.button):not(.rte-button):not(.rte-button--full) { a.rte-button { @apply inline-flex items-center justify-center px-4 py-2 md:px-8; @apply uppercase leading-none text-center; - @apply transition-colors outline-none focus:outline-none; + @apply transition-colors outline-none; @apply bg-ep-primary-light text-white; @apply sbw:bg-sbw-secondary; @apply snz:bg-snz-secondary; @@ -45,6 +45,10 @@ a.rte-button { @apply suz:hover:bg-suz-primary-dark suz:group-hover:bg-suz-primary-dark; @apply uch:hover:bg-uch-primary-dark uch:group-hover:bg-uch-primary-dark; @apply ser:hover:bg-ser-primary ser:group-hover:bg-ser-primary; + @apply focus:outline focus:outline-2 focus:outline-offset-2; + @apply focus:outline-ep-primary-dark sbw:focus:outline-sbw-secondary uch:focus:outline-uch-secondary; + @apply suz:focus:outline-suz-secondary ser:focus:outline-ser-secondary snz:focus:outline-snz-secondary; + } a.rte-button--full { diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_buttons.scss b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_buttons.scss index 6640c231..b64c6aa1 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_buttons.scss +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_buttons.scss @@ -2,6 +2,9 @@ @apply inline-flex items-center justify-center space-x-2 px-4 py-2 md:px-8 cursor-pointer; @apply uppercase leading-none text-center; @apply transition-colors outline-none; + @apply focus:outline focus:outline-2 focus:outline-offset-2; + @apply focus:outline-ep-primary-dark sbw:focus:outline-sbw-secondary uch:focus:outline-uch-secondary; + @apply suz:focus:outline-suz-secondary ser:focus:outline-ser-secondary snz:focus:outline-snz-secondary; &--small { @apply px-2 py-1 md:px-4 text-xs sm:text-sm; @@ -12,6 +15,28 @@ } } +.teaser-button { + @apply w-full; + @apply bg-ep-primary-dark text-white; + @apply sbw:bg-sbw-secondary; + @apply snz:bg-snz-secondary; + @apply suz:bg-suz-secondary; + @apply uch:bg-uch-secondary; + @apply ser:bg-ser-secondary; + @apply hover:bg-badge-gradient hover:text-white; + @apply peer-hover:bg-badge-gradient peer-hover:text-white; + @apply sbw:hover:bg-none sbw:hover:bg-sbw-primary-dark; + @apply snz:hover:bg-none snz:hover:bg-snz-primary-dark; + @apply suz:hover:bg-none suz:hover:bg-suz-primary-dark; + @apply uch:hover:bg-none uch:hover:bg-uch-primary-dark; + @apply ser:hover:bg-none ser:hover:bg-ser-primary; + @apply sbw:peer-hover:bg-none sbw:peer-hover:bg-sbw-primary-dark; + @apply snz:peer-hover:bg-none snz:peer-hover:bg-snz-primary-dark; + @apply suz:peer-hover:bg-none suz:peer-hover:bg-suz-primary-dark; + @apply uch:peer-hover:bg-none uch:peer-hover:bg-uch-primary-dark; + @apply ser:peer-hover:bg-none ser:peer-hover:bg-ser-primary; +} + .bg-button { @apply bg-ep-primary-dark text-white; @apply sbw:bg-sbw-secondary; @@ -19,41 +44,27 @@ @apply suz:bg-suz-secondary; @apply uch:bg-uch-secondary; @apply ser:bg-ser-secondary; - @apply hover:bg-ep-secondary; - @apply hover:text-gray-900; - @apply sbw:hover:bg-sbw-primary-dark; - @apply snz:hover:bg-snz-primary-dark; - @apply suz:hover:bg-suz-primary-dark; - @apply uch:hover:bg-uch-primary-dark; - @apply ser:hover:bg-ser-primary; - @apply peer-hover:bg-ep-secondary; - @apply peer-hover:text-gray-900; - @apply sbw:peer-hover:bg-sbw-primary-dark; - @apply snz:peer-hover:bg-snz-primary-dark; - @apply suz:peer-hover:bg-suz-primary-dark; - @apply uch:peer-hover:bg-uch-primary-dark; - @apply ser:peer-hover:bg-ser-primary; + @apply hover:bg-badge-gradient hover:text-white; + @apply sbw:hover:bg-none sbw:hover:bg-sbw-primary-dark; + @apply snz:hover:bg-none snz:hover:bg-snz-primary-dark; + @apply suz:hover:bg-none suz:hover:bg-suz-primary-dark; + @apply uch:hover:bg-none uch:hover:bg-uch-primary-dark; + @apply ser:hover:bg-none ser:hover:bg-ser-primary; &--active, &--secondary { - @apply bg-ep-secondary text-gray-900; - @apply sbw:bg-sbw-primary; - @apply snz:bg-snz-primary; - @apply suz:bg-suz-primary; - @apply uch:bg-uch-primary; - @apply ser:bg-ser-secondary; - @apply hover:bg-ep-primary-dark hover:text-white; - @apply sbw:hover:bg-sbw-primary-dark; - @apply snz:hover:bg-snz-primary-dark; - @apply suz:hover:bg-suz-primary-dark; - @apply uch:hover:bg-uch-primary-dark; - @apply ser:hover:bg-ser-primary; - @apply peer-hover:bg-ep-primary-dark peer-hover:text-white; - @apply sbw:peer-hover:bg-sbw-primary-dark; - @apply snz:peer-hover:bg-snz-primary-dark; - @apply suz:peer-hover:bg-suz-primary-dark; - @apply uch:peer-hover:bg-uch-primary-dark; - @apply ser:peer-hover:bg-ser-primary; + @apply bg-badge-gradient text-white; + @apply sbw:bg-none sbw:bg-sbw-secondary; + @apply snz:bg-none snz:bg-snz-secondary; + @apply suz:bg-none suz:bg-suz-secondary; + @apply uch:bg-none uch:bg-uch-secondary; + @apply ser:bg-none ser:bg-ser-secondary; + @apply hover:bg-none hover:bg-ep-pink hover:text-white; + @apply sbw:hover:bg-none sbw:hover:bg-sbw-primary-dark; + @apply snz:hover:bg-none snz:hover:bg-snz-primary-dark; + @apply suz:hover:bg-none suz:hover:bg-suz-primary-dark; + @apply uch:hover:bg-none uch:hover:bg-uch-primary-dark; + @apply ser:hover:bg-none ser:hover:bg-ser-primary; } &--muted { @@ -78,8 +89,7 @@ &:hover, &.button--active { - @apply bg-white; - @apply border-ep-secondary text-ep-secondary; + @apply bg-none bg-ep-pink border-ep-pink; @apply sbw:bg-white sbw:border-sbw-secondary sbw:text-sbw-secondary; @apply snz:bg-white snz:border-snz-secondary snz:text-snz-secondary; @apply suz:bg-white suz:border-suz-secondary suz:text-suz-secondary; diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_contact-bar.scss b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_contact-bar.scss index 9a24e298..57f9e24a 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_contact-bar.scss +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_contact-bar.scss @@ -9,7 +9,7 @@ .contact-bar__item { @apply flex-1 text-white py-2 bg-ep-primary-dark border-r border-white last:border-0; - @apply ser:bg-ser-primary sbw:bg-sbw-primary snz:bg-snz-primary suz:bg-suz-primary uch:bg-uch-primary; + @apply ser:bg-ser-primary sbw:bg-sbw-secondary snz:bg-snz-primary suz:bg-suz-primary uch:bg-uch-primary; @screen md { @apply flex flex-none items-start transition-transform duration-300 ease-in-out p-1 shadow-md focus:text-white border-0; diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_forms.scss b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_forms.scss index 5dd18e70..793df8c3 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_forms.scss +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_forms.scss @@ -1,5 +1,6 @@ .form-field { - @apply border-zinc-400 focus:border-zinc-800 ring-0 focus:ring-0 mt-1 block w-full; + @apply border-zinc-400 focus:border-zinc-800 ring-0 block w-full mt-1; + @apply focus:ring-0 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-zinc-800; &--has-error { @apply border-red-500; @@ -9,6 +10,7 @@ .form-checkbox, .form-radio { @apply border-zinc-400 focus:border-zinc-800 ring-0 focus:ring-0 text-ep-secondary sbw:text-sbw-secondary uch:text-uch-secondary h-4 w-4; + @apply focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-zinc-800; &--has-error { @apply border-red-500; diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Badge.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Badge.html index 7a8b871b..73bf15e6 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Badge.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Badge.html @@ -14,11 +14,11 @@
- + {badge.title -> f:format.raw()} - + {badge.subtitle -> f:format.raw()} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html index e993f9eb..36c1aa2d 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html @@ -42,7 +42,7 @@
{city.teaser -> f:format.crop(maxCharacters: settings.teaserTextMaxChars) -> f:format.html()}
-
+
{f:translate(key: 'tx_eptheme.label.teaserbutton.default', extensionName: 'ep_theme')}
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html index 2a6d11bf..7976c6ad 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html @@ -5,6 +5,7 @@ + class="contact-bar__item" + additionalAttributes="{tabindex: 0}"> {ep:icon(icon: 'email', class: 'contact-bar__icon')}
{settings.contactFormToEmail} @@ -31,6 +34,7 @@ @@ -41,6 +45,7 @@ @@ -50,6 +55,7 @@
@@ -59,6 +65,7 @@
@@ -69,6 +76,7 @@ @@ -79,7 +87,9 @@ - + {ep:icon(icon: 'flag-gb', class: 'contact-bar__icon')}
English @@ -87,7 +97,9 @@ - + {ep:icon(icon: 'flag-de', class: 'contact-bar__icon')}
Deutsch diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Footer.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Footer.html index 383d7ab0..ec91f1aa 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Footer.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Footer.html @@ -179,7 +179,7 @@ data-action="scroll-top#scroll" data-scroll-top-hidden-class="hidden" data-scroll-top-visible-class="flex" - class="hidden fixed bottom-0 right-0 mb-16 md:mb-8 mr-4 md:mr-8 z-10 h-10 w-10 items-center justify-center rounded bg-ep-secondary/80 ser:bg-ser-secondary"> + class="hidden fixed bottom-0 right-0 mb-16 md:mb-8 mr-4 md:mr-8 z-10 h-10 w-10 items-center justify-center rounded bg-ep-pink/80 sbw:bg-sbw-secondary/80 snz:bg-snz-secondary/80 uch:bg-uch-secondary/80 ser:bg-ser-secondary/80"> {ep:icon(icon: 'chevron-up', class: 'w-8 h-8 text-white')} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/HeaderSlider.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/HeaderSlider.html index 15da6624..5097109d 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/HeaderSlider.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/HeaderSlider.html @@ -35,7 +35,7 @@ + class="button bg-badge-gradient hover:bg-none hover:bg-ep-pink text-white inline-block"> {slide.button} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/Teaser.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/Teaser.html index b218ac06..c93c788d 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/Teaser.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/Teaser.html @@ -31,9 +31,9 @@ - +
Kategorie {hotel.category} - +
{hotel.teaser -> f:format.crop(maxCharacters: settings.teaserTextMaxChars) -> f:format.html()} @@ -43,7 +43,7 @@
-
+
{f:translate(key: 'tx_eptheme.label.teaserbutton.default', extensionName: 'ep_theme')}
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Mainnav.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Mainnav.html index 1713a69c..fb3808c8 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Mainnav.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Mainnav.html @@ -44,13 +44,19 @@