-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
235 lines (187 loc) · 9.74 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html lang="en">
<head>
<title>Accessible carousel boilerplates by Accessible360</title>
<meta name="description" content="Pre-built, highly accessible code samples for popular carousel packages including Slick Slider, Flickity, Splide, and more!">
<meta name="keywords" content="accessible, accessibility, WCAG, carousel, slider, Slick, Flickity, Splide, Owl, jQuery, template, boilerplate">
<!-- Open Graph -->
<meta property="og:title" content="Accessible carousel boilerplates by Accessible360">
<meta property="og:description" content="Pre-built, highly accessible code samples for popular carousel packages including Slick Slider, Flickity, Splide, and more!">
<meta property="og:type" content="website">
<meta property="og:image" content="https://accessible360.github.io/accessible-carousel-boilerplates/images/social-media-preview.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Accessible carousel boilerplates by Accessible360">
<meta name="twitter:description" content="Pre-built, highly accessible code samples for popular carousel packages including Slick Slider, Flickity, Splide, and more!">
<meta name="twitter:creator" content="Accessible360">
<meta name="twitter:image:src" content="https://accessible360.github.io/accessible-carousel-boilerplates/images/social-media-preview.png">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
</head>
<body>
<div class="container">
<header>
<img src="images/carousel-hero.jpg" class="hero-image" alt="">
<div class="title-container">
<h1>Accessible carousel boilerplates</h1>
</div>
</header>
<main>
<p>Carousels aren't <a href="https://erikrunyon.com/2013/01/carousel-interaction-stats">effective</a> or <a href="https://www.nngroup.com/articles/auto-forwarding">popular</a> with real users, but sometimes you just have no choice! At <a href="https://accessible360.com">Accessible360</a>, we see carousels on client sites every day, and we've found them to be a common source of accessibility barriers practically every time they are used.</p>
<p>To help make a difference for end users and developers sooner rather than later, we're releasing this set of realistic, ready-to-use code snippets for popular carousel packages that you can start using right now to create more accessible carousels and sliders! So far we have snippets for:</p>
<ul>
<li><a href="#accessible-slick">accessible-slick</a></li>
<li><a href="#Flickity">Flickity</a></li>
<li><a href="#Owl-Carousel-2">Owl Carousel 2</a></li>
<li><a href="#Slick-Slider">Slick Slider</a></li>
<li><a href="#Splide">Splide</a></li>
</ul>
<p>If you'd like to see snippets for other carousel packages or use cases, <a href="https://github.com/Accessible360/accessible-carousel-boilerplates/issues">please let us know</a>!</p>
<p>All of these code snippets can also be found over on <a href="https://codepen.io/collection/narjZO">CodePen in this collection</a> (they are exactly the same!).</p>
<section>
<h2 id="accessible-slick" tabindex="-1">accessible-slick</h2>
<p><a href="https://github.com/Accessible360/accessible-slick">accessible-slick</a> is a drop-in replacement for the classic Slick Slider package that adds a layer of built-in accessibility improvements. Since practically all of its accessibility improvements are baked right into the package, these code snippets end up being the smallest and simplest.</p>
<ul>
<li><a href="accessible-slick/hero-banner.html">Hero banner</a></li>
<li><a href="accessible-slick/linked-product-cards.html">Linked product cards</a></li>
<li><a href="accessible-slick/pdp-product-image-with-thumbnails.html">PDP product image with thumbnails</a></li>
<li><a href="accessible-slick/product-tiles-with-quick-view-functionality.html">Product tiles with quick view functionality</a></li>
</ul>
<h2 id="Flickity" tabindex="-1">Flickity</h2>
<p><a href="https://github.com/metafizzy/flickity">Flickity</a> has some good things going for it, but also a few major issues for accessibility. Avoid using the <code>wrapAround</code> and <code>accessibility</code> options, and be sure to hide all the interactive content inside of each slide.</p>
<ul>
<li><a href="Flickity/hero-banner.html">Hero banner</a></li>
<li><a href="Flickity/linked-product-cards.html">Linked product cards</a></li>
<li><a href="Flickity/pdp-product-image-with-thumbnails.html">PDP product image with thumbnails</a></li>
<li><a href="Flickity/product-tiles-with-quick-view-functionality.html">Product tiles with quick view functionality</a></li>
</ul>
<h2 id="Owl-Carousel-2" tabindex="-1">Owl Carousel 2</h2>
<p><a href="https://github.com/OwlCarousel2/OwlCarousel2">Owl Carousel 2</a> is officially deprecated and should not be used for new projects! Avoid using the inaccessible built-in slide dots, and be sure to use the events API to hide all non-visible slides.</p>
<ul>
<li><a href="Owl Carousel 2/hero-banner.html">Hero banner</a></li>
<li><a href="Owl Carousel 2/linked-product-cards.html">Linked product cards</a></li>
<li><a href="Owl Carousel 2/pdp-product-image-with-thumbnails.html">PDP product image with thumbnails</a></li>
<li><a href="Owl Carousel 2/product-tiles-with-quick-view-functionality.html">Product tiles with quick view functionality</a></li>
</ul>
<h2 id="Slick-Slider" tabindex="-1">Slick Slider</h2>
<p><a href="https://github.com/kenwheeler/slick">Slick Slider</a> is perhaps the most widely-used carousel package, even though it has been <a href="https://github.com/kenwheeler/slick/graphs/contributors">abandoned</a> (though not officially deprecated) by its author. Ironically, you should avoid the <code>accessibility</code> option, since it actually makes the markup worse for disabled users! Be sure to use the latest version (1.8.1 as of May 2021), which includes some important updates that affect accessibility. Custom JavaScript will be needed to ensure that non-visible slides are actually hidden.</p>
<ul>
<li><a href="Slick Slider/hero-banner.html">Hero banner</a></li>
<li><a href="Slick Slider/linked-product-cards.html">Linked product cards</a></li>
<li><a href="Slick Slider/pdp-product-image-with-thumbnails.html">PDP product image with thumbnails</a></li>
<li><a href="Slick Slider/product-tiles-with-quick-view-functionality.html">Product tiles with quick view functionality</a></li>
</ul>
<h2 id="Splide" tabindex="-1">Splide</h2>
<p><a href="https://github.com/Splidejs/splide">Splide</a> may be the most accessible package of all of these, with good use of semantic HTML. Avoid the <code>keyboard</code> and <code>slideFocus</code> options. Some minor work needs to be done to ensure that non-visible slides are fully hidden.</p>
<ul>
<li><a href="Splide/hero-banner.html">Hero banner</a></li>
<li><a href="Splide/linked-product-cards.html">Linked product cards</a></li>
<li><a href="Splide/pdp-product-image-with-thumbnails.html">PDP product image with thumbnails</a></li>
<li><a href="Splide/product-tiles-with-quick-view-functionality.html">Product tiles with quick view functionality</a></li>
</ul>
</section>
</main>
</div>
<footer>
<p>Brought to you by <a href="https://accessible360.com" target="_blank">Accessible360</a></p>
<a href="https://accessible360.com" target="_blank" class="logo-link"><img src="./images/accessible360-tag-logo-white.png" alt="Accessible360.com" ></a>
</footer>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
margin: 40px;
background-color: #005166;
}
@media screen and (max-width: 768px) {
body {
margin: 0;
}
}
.container {
width: 100%;
max-width: 960px;
margin: 0 auto;
background-color: white;
}
main {
padding: 10px 60px 60px 60px;
line-height: 24px;
}
@media screen and (max-width: 768px) {
main {
padding: 30px;
}
}
header {
position: relative;
}
header .hero-image {
width: calc(100% - 20px);
margin: 10px;
}
header .title-container {
position: absolute;
bottom: 0;
width: calc(100% - 40px);
margin: 20px 20px 0 20px;
display: flex;
justify-content: center;
align-items: center;
}
header .title-container h1 {
display: inline-block;
margin: 0;
padding: 10px 30px;
background-color: white;
font-family: monospace;
font-size: 36px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
footer {
width: 100%;
max-width: 960px;
margin: 0 auto;
margin-top: 30px;
color: white;
text-align: center;
}
footer p {
margin-bottom: 0;
}
footer p a {
color: white;
font-weight: bold;
}
footer .logo-link {
display: inline-block;
}
footer .logo-link img {
display: block;
width: auto;
height: 100px;
}
h2 {
margin-top: 30px;
margin-bottom: 10px;
}
a {
color: #005166;
}
ul {
}
ul li {
margin: 5px 0;
}
section {
margin-top: 50px;
}
</style>
</body>
</html>