Improves a11y of password protected video form

According to the WCAG success criterias 1.3.1 (Info and relationships),
3.3.2 (Labels or Instructions) and 4.1.2 (Name, Role, Value), labels
or instructions are required when content requires user input.

To do so, this commit adds a label for the password input and hide it
with a CSS visually-hidden method to not alter the design.

Resources:
- https://www.w3.org/TR/WCAG21/#labels-or-instructions
- https://www.w3.org/TR/WCAG21/#info-and-relationships
- https://www.w3.org/TR/WCAG21/#name-role-value
- https://www.w3.org/TR/WCAG20-TECHS/H44.html
- https://www.w3.org/WAI/WCAG21/Understanding/labels-or-instructions.html
- https://gomakethings.com/hidden-content-for-better-a11y/
This commit is contained in:
Damien Senger 2019-04-13 13:11:09 +02:00
parent 726e9bf5c1
commit ce07a621e5
No known key found for this signature in database
GPG key ID: A718C115E3DFF8B7
2 changed files with 450 additions and 447 deletions

View file

@ -1,14 +1,11 @@
body {
background-color: #EBEBEB;
background-image:url('../img/fond.jpg');
font-family: 'Open Sans', sans-serif;
background-color: #ebebeb;
background-image: url("../img/fond.jpg");
font-family: "Open Sans", sans-serif;
font-weight: 400;
text-align: center;
}
/* Header */
header {
@ -23,7 +20,6 @@ header {
padding-right: 21px;
}
header .social a {
background-position: 0 0;
background-repeat: no-repeat;
@ -50,11 +46,11 @@ header a:hover {
}
.share {
background-image:url('../img/share.png');
background-image: url("../img/share.png");
}
.sharemask {
background-image:url('../img/sharemask.png');
background-image: url("../img/sharemask.png");
background-position: top left;
background-repeat: no-repeat;
height: 38px;
@ -63,15 +59,14 @@ header a:hover {
top: 0;
width: 38px;
z-index: 10;
}
.facebook {
background-image:url('../img/facebook.png');
background-image: url("../img/facebook.png");
}
.facebookmask {
background-image:url('../img/facebookmask.png');
background-image: url("../img/facebookmask.png");
background-position: top left;
background-repeat: no-repeat;
height: 38px;
@ -83,11 +78,11 @@ header a:hover {
}
.twitter {
background-image:url('../img/twitter.png');
background-image: url("../img/twitter.png");
}
.twittermask {
background-image:url('../img/twittermask.png');
background-image: url("../img/twittermask.png");
background-position: top left;
background-repeat: no-repeat;
height: 38px;
@ -98,13 +93,10 @@ header a:hover {
z-index: 10;
}
/* Footer */
footer {
background-image:url('../img/fondfooter.png');
background-image: url("../img/fondfooter.png");
background-position: top left;
background-repeat: repeat-x;
bottom: 0;
@ -137,11 +129,6 @@ footer a:hover {
-o-transition: all 0.1s ease-in;
}
/* Home content */
.logo {
@ -161,7 +148,7 @@ footer a:hover {
}
.downloadBtn {
background-color:#3A3A3A;
background-color: #3a3a3a;
border: 3px solid #a5a5a5;
border-radius: 10px;
color: #dedede;
@ -193,7 +180,7 @@ footer a:hover {
background-color: #fff;
border: 3px solid #a5a5a5;
border-radius: 10px;
color:#3F3F3F;
color: #3f3f3f;
font-weight: 800;
margin-right: 8px;
min-width: 426px;
@ -201,9 +188,8 @@ footer a:hover {
position: relative;
}
.URLinput:focus {
border-color:#3A3A3A;
border-color: #3a3a3a;
outline: none;
}
@ -215,7 +201,7 @@ footer a:hover {
}
.combatiblelink {
background-image:url('../img/compatiblerouage.png');
background-image: url("../img/compatiblerouage.png");
background-position: 0 100%;
background-repeat: no-repeat;
color: #a5a5a5;
@ -280,7 +266,7 @@ footer a:hover {
.audio:checked + label:before,
.audio:not(:checked) + label:after,
.audio:checked + label:after {
content: '';
content: "";
position: absolute;
}
.audio:not(:checked) + label:before,
@ -290,11 +276,11 @@ footer a:hover {
height: 20px;
left: 0;
top: -1px;
-webkit-transition: background-color .2s;
-moz-transition: background-color .2s;
-ms-transition: background-color .2s;
-o-transition: background-color .2s;
transition: background-color .2s;
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
-ms-transition: background-color 0.2s;
-o-transition: background-color 0.2s;
transition: background-color 0.2s;
width: 45px;
}
.audio:not(:checked) + label:after,
@ -304,11 +290,11 @@ footer a:hover {
height: 16px;
left: 2px;
top: 1px;
-webkit-transition: all .2s;
-moz-transition: all .2s;
-ms-transition: all .2s;
-o-transition: all .2s;
transition: all .2s;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
width: 16px;
}
@ -336,15 +322,15 @@ footer a:hover {
left: 3px;
line-height: 17px;
position: absolute;
-webkit-transition: all .2s;
-moz-transition: all .2s;
-ms-transition: all .2s;
-o-transition: all .2s;
transition: all .2s;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
width: 45px;
}
.audio:not(:checked) + label .ui:before {
background-image:url('../img/mp3hover.png');
background-image: url("../img/mp3hover.png");
background-position: right top;
background-repeat: no-repeat;
content: "no";
@ -352,23 +338,23 @@ footer a:hover {
min-width: 56px;
padding-left: 23px;
padding-top: 2px;
-webkit-transition: all .2s;
-moz-transition: all .2s;
-ms-transition: all .2s;
-o-transition: all .2s;
transition: all .2s;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
.audio:checked + label .ui:after {
background-image:url('../img/mp3.png');
background-image: url("../img/mp3.png");
background-position: right top;
background-repeat: no-repeat;
color: #fff;
content: "yes";
-webkit-transition: all .2s;
-moz-transition: all .2s;
-ms-transition: all .2s;
-o-transition: all .2s;
transition: all .2s;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
width: 73px;
}
@ -382,7 +368,6 @@ footer a:hover {
display: block;
}
/* Playlists */
.playlist-entry .thumb {
float: left;
@ -413,9 +398,6 @@ footer a:hover {
font-size: 16px;
}
/* Supported websites list */
.logobis {
@ -425,9 +407,8 @@ footer a:hover {
width: 447px;
}
.logocompatible {
background-image:url('../img/logocompatible.png');
background-image: url("../img/logocompatible.png");
background-position: 0 0;
background-repeat: repeat-y;
display: block;
@ -447,9 +428,8 @@ footer a:hover {
-o-transition: all 0.1s ease-in;
}
.logocompatiblemask {
background-image:url('../img/logocompatiblemask.png');
background-image: url("../img/logocompatiblemask.png");
background-position: 0 100%;
background-repeat: no-repeat;
height: 107px;
@ -462,7 +442,7 @@ footer a:hover {
.titre {
color: #383838;
font-family: 'Open Sans', sans-serif;
font-family: "Open Sans", sans-serif;
font-size: 48px;
font-weight: 300;
}
@ -475,7 +455,6 @@ footer a:hover {
width: 800px;
}
.tripleliste ul {
margin-bottom: 1em;
margin-left: 120px;
@ -525,10 +504,10 @@ body {
}
.social a {
color:#D1D1D1;
color: #d1d1d1;
}
.logocompatible {
color: #4F4F4F
color: #4f4f4f;
}
h1 {
@ -591,7 +570,7 @@ h1 {
}
.supportedLocales li {
border-bottom: thin solid #E1E1E1;
border-bottom: thin solid #e1e1e1;
}
.supportedLocales li:last-child {
@ -687,7 +666,7 @@ h1 {
}
.logocompatible {
background-color:#4F4F4F;
background-color: #4f4f4f;
background-image: none;
height: auto;
}
@ -723,7 +702,6 @@ h1 {
float: none;
margin-right: 0;
}
}
@media all and (display-mode: standalone) {
@ -731,3 +709,27 @@ h1 {
display: none;
}
}
/* Visually hidden, displays content only to screen-readers */
.sr-only {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
white-space: nowrap;
width: 1px;
}
.sr-only.focusable:active,
.sr-only.focusable:focus {
clip: auto;
height: auto;
margin: 0;
overflow: visible;
position: static;
white-space: normal;
width: auto;
}

View file

@ -5,7 +5,8 @@
<h2>{t}This video is protected{/t}</h2>
<p>{t}You need a password in order to download this video.{/t}</p>
<form action="" method="POST">
<input class="URLinput" type="password" name="password" title="{t}Video password{/t}" />
<label class="sr-only" for="password">{t}Video password{/t}</label>
<input class="URLinput" type="password" name="password" id="password" />
<br/><br/>
<input class="downloadBtn" type="submit" value="{t}Download{/t}" />
</form>