Skip to content

Commit

Permalink
TMS-936: Image carousel accessibility fixes (#35)
Browse files Browse the repository at this point in the history
* TMS-936: Image carousel accessibility fixes

* 1.1.5
  • Loading branch information
eebbi authored Oct 11, 2023
1 parent 4c80239 commit 1fb6532
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.1.6] - 2023-10-12

- TMS-936: Image carousel accessibility fixes

## [1.1.5] - 2023-10-09

- TMS-978: Remove manual-event styles
Expand Down
22 changes: 11 additions & 11 deletions partials/layouts/layout-image-carousel.dust
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="columns is-multiline">

{?title}
<h3 id="{carousel_id}-title"
<h3 id="{carousel_id|attr}-title"
class="image-carousel__title column is-block is-half is-offset-one-quarter has-text-centered mt-0 mb-0 {carousel_title_class|attr} {txt_color_class|attr}">
{title|html}
</h3>
Expand All @@ -19,19 +19,19 @@
<div class="image-carousel__inner column is-full">
<button class="button button--icon is-primary is-rounded slick-prev slick-arrow" type="button">
{>"ui/icon" icon="chevron-left" /}
<span class="is-sr-only">{Strings.s.gallery.previous|html}</span>
<span class="is-sr-only">{translations.previous|html}</span>
</button>

<div class="image-carousel__items image-carousel__items--primary"
id="{carousel_id}" data-slider-for="{carousel_id}-modal-carousel">
id="{carousel_id|attr}" data-slider-for="{carousel_id|attr}-modal-carousel">
{#rows}
<div class="image-carousel__item" id="{id}">
<div class="image-carousel__item" id="{id|attr}">
{! Modal trigger !}
<button
class="image modal-trigger {shape}"
class="image modal-trigger {shape|attr}"
data-modal-button
data-target="{carousel_id}-modal"
aria-controls="{carousel_id}-modal"
data-target="{carousel_id|attr}-modal"
aria-controls="{carousel_id|attr}-modal"
aria-expanded="false"
aria-haspopup="true"
aria-label="{translations.open}"
Expand All @@ -44,27 +44,27 @@

<button class="button button--icon is-primary is-rounded slick-next slick-arrow" type="button">
{>"ui/icon" icon="chevron-right" /}
<span class="is-sr-only">{Strings.s.gallery.next|html}</span>
<span class="is-sr-only">{translations.next|html}</span>
</button>
</div>
</div>
</div>

{! The modal !}
<div id="{carousel_id}-modal" class="modal modal--large modal--slider" role="dialog" aria-modal="true" aria-labelledby="{carousel_id}">
<div id="{carousel_id|attr}-modal" class="modal modal--large modal--slider" role="dialog" aria-modal="true" aria-labelledby="{carousel_id|attr}">
<div class="modal-background"></div>

<button
class="button button--icon modal-close-button is-flex is-align-self-flex-end image-carousel__modal-control">
<span class="modal-close-button__text">{translations.close}</span>
<span class="modal-close-button__text">{translations.close|html}</span>
{>"ui/icon" icon="close" class="icon--medium" /}
</button>
<div class="modal-content">

{! Slider inside the modal !}
<div class="image-carousel__items image-carousel__items--modal column is-full" id="{carousel_id}-modal-carousel" data-slider-for="{carousel_id}">
{#rows}
<div class="image-carousel__item" id="{id}-modal">
<div class="image-carousel__item" id="{id|attr}-modal">
<div class="img-wrapper">
{@image id=image.id alt=image.alt title=image.alt size="fullhd" width="{image.sizes.fullhd-width}" height="{image.sizes.fullhd-height}" loading="" /}
</div>
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Theme Name: TMS Theme Amuri
* Description: Tampere Multisite Amuri Theme
* Version: 1.1.2
* Version: 1.1.5
* Author: Geniem
* Author URI: https://geniem.fi
* Template: tms-theme-base
Expand Down

0 comments on commit 1fb6532

Please sign in to comment.