Everyone can perceive, understand, navigate, and interact with the Web, and they can contribute to the Web.
Created by Marcy Sutton / @marcysutton
Expands HTML's semantic vocabulary
What does this thing do?
<div role="img" style="background-image..."></div>
The current condition of this particular thing
<material-input aria-disabled="true"></material-input>
The nature of the current object
<doner-kebab aria-label="Lunch courtesy AngelinaMagnum">
Disables a screen reader’s “virtual cursor”
<sparkle-party role="application"></sparkle-party>
<body role="application">
<sparkle-party>
<h2>Do you like to dance?</h2>
<button class="lets-dance">I wore my party pants</button>
<disco-ball>
<canvas></canvas>
<p aria-live="polite" class="disco-transcript"></p>
</disco-ball>
</sparkle-party>
<div tabIndex="0"></div>
<div class="menu" ng-click="toggleMenu()"></div>
<dance-button tabIndex="0"
ng-click="spicy123(go);">
DANCE!
</dance-button>
<dance-button tabIndex="0" role="button"
ng-click="letsGetDown(toThat)"
ng-keypress="letsGetDown(toThat)">
DANCE!
</dance-button>
[tabIndex="0"] {
color: $linkColor;
&:focus, &:hover {
color: $linkActiveColor;
outline: default;
}
}
Photo by Matthew Bergman
{{party-pants}}
App.PartyPantsComponent = Ember.Component.extend({
tagName: 'party-pants',
ariaRole: 'article',
attributeBindings: ['tabIndex'],
tabIndex: function() {
return this.get('active') ? 0 : -1;
}.property('active')
});
// AngularUI Bootstrap
<accordion-group
is-open="status.open"
is-disabled="status.isDisabled">
</accordion-group>
// AngularUI Bootstrap
<accordion-group
aria-expanded="true"
is-open="status.open"
aria-disabled="false"
is-disabled="status.isDisabled">
</accordion-group>
// AngularUI Bootstrap
<accordion-group
ng-expanded="status.open"
ng-disabled="status.isDisabled">
</accordion-group>
<material-radio-group ng-model="data.group">
<material-radio-button value="1">
Label 1
</material-radio-button>
<material-radio-button value="2">
Label 2
</material-radio-button>
</material-radio-group>
function materialRadioGroupDirective() {
element.attr({
'role': 'radiogroup',
'tabIndex': '0'
})
.on('keydown', keydownListener);
function keydownListener(ev) {
if (ev.which === Constant.KEY_CODE.LEFT_ARROW) {
rgCtrl.selectPrevious(element);
}
else if (ev.which === Constant.KEY_CODE.RIGHT_ARROW) {
rgCtrl.selectNext(element);
}
}
}
function materialRadioButtonDirective($expectAria) {
element.attr('role', 'radio');
$expectAria(element, 'aria-label', element.text());
var lastChecked;
attr.observe('value', render);
function render() {
var checked = (rgCtrl.getViewValue() === attr.value);
if(checked === lastChecked){ return; }
lastChecked = checked;
element.attr('aria-checked', checked);
}
}
Thanks, JSConf EU! -@marcysutton