@stowball
Senior UX Engineer at
National Rugby League
“We should be able to access the web … regardless of the software we use, the computer we have, the language we speak … and regardless of our sensory or interaction modes”
“ ‘People with disability’ is the only minority group that anyone can join at any time”
Equal access is often required by law
People with full or partial hearing loss
People with ADD, autism, dementia, dyslexia and more
People with limited dexterity or upper limb disabilities
(red-green)
(another red-green)
(blue-yellow)
All have slightly different features and results, and are useful at different times in the process
I highly recommend doing the VoiceOver Training course that's built in to macOS to learn more
* Terrible pun
function keyboardFocus (e) {
if (e.keyCode !== 9) {
return;
}
document.documentElement.classList.add('keyboard-focus');
document.removeEventListener('keydown', keyboardFocus, false);
}
document.addEventListener('keydown', keyboardFocus, false);
:focus {
box-shadow: none;
outline: none;
}
.no-js :focus, .keyboard-focus .element:focus {
box-shadow: 0 0 2px 1px #00cdcb;
}
:focus {
box-shadow: none;
outline: none;
}
.element:focus-ring {
box-shadow: 0 0 2px 1px #00cdcb;
}
.chip.is-hidden {
max-width: 0;
opacity: 0;
transform: scale(0);
transition: opacity ease 0.25s,
transform ease 0.25s,
margin ease 0.45s 0.15s,
max-width ease 0.45s 0.15s,
visibility 0s 0.6s;
visibility: hidden;
}
<nav role="navigation" aria-label="Main">
<button aria-label="Navigation" aria-controls="menu"
aria-haspopup="true" aria-expanded="false"
>🍔</button>
<ul id="menu">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
</ul>
</nav>
var $button = $('button');
var isMenuOpen = false;
$button.on('click', function () {
isMenuOpen = !isMenuOpen;
$button.attr('aria-expanded', isMenuOpen);
});
button[aria-expanded="true"] {
/* change caret indicator */
}
button[aria-expanded="true"] + #menu {
/* show menu */
}
<div class="product">
<!-- This should be in a form with a server-side fallback -->
<h3>Super Mario T-shirt</h3>
<button class="btn btn-default">
Add <span class="u-visually-hidden">Super Mario T-shirt</span> to cart
</button>
</div>
<div id="toaster" role="alert" aria-atomic="true" aria-live="assertive"></div>
var $button = $('button');
var $toaster = $('#toaster');
$button.on('click', function () {
$toaster
.html('<span class="u-visually-hidden">Super Mario T-shirt has been </span>' +
'Added to your cart').addClass('is-visible');
setTimeout(function () {
$toaster.removeClass('is-visible');
}, 1500);
});
.u-visually-hidden {
/* https://gist.github.com/stowball/2704364c1ceefb1d7eaf570b903463b3 */
}
@stowball