-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create "Accessibility" article #17
Comments
Provide the following so an article can be drafted that provides more detailed background information about key features of Accessibility and key concepts and patterns for being effective in working with it in Dojo 2:
|
Sorry this is late, I'm still a little ambivalent about it. Any feedback is very welcome: Philosophy & ApproachDojo 2 is grounded in the belief that accessibility is as important online as it is in our built environments, and architects of both share a similar responsibility to provide access to all. Accessibility failures abound in each setting, and they can be very obvious once one starts looking:
Web developers have an additional hurdle to jump over, since accessibility failures online are often invisible and silent. Without proper testing, it is all too easy to add a The advances in spec and support for ARIA attributes are fantastic, but they can feed into the false impression that accessibility is achieved by slapping an Using Dojo 2 WidgetsAll widgets provided through Form ControlsAll simple form controls ( For example, a TextInput widget with the following properties: w(TextInput, {
describedBy: ‘foo’,
disabled: true,
invalid: true,
type: ‘email’
}); Would create the following attributes on the input node: LabelAll form widgets apart from The A StylingThe base Dojo 2 theme meets WCAG AA color contrast guidelines, but it is up to the user to double check the final styles as changes to font size or background could affect readability. Widget css packaged with Dojo2 also includes There is a set of base styles provided by import * as css from ‘path/to/your/css’;
import * as baseCss from ‘@dojo/widgets/common/styles/base.m.css’;
@theme(css)
class MyWidget extends WidgetBase {
render() {
return v(‘div’, {
classes: this.classes().fixed(baseCss.visuallyHidden)
}, [ ‘Screen reader instructions’ ]);
}
} Focus ManagementDojo 2 will provide a focus manager for situations where focus needs to be directly managed, since directly touching the DOM within widgets is discouraged. This feature is currently in development. Writing Custom WidgetsAll DOM attributes can be set with v('button', {
key: 'buttonKey',
'aria-controls': 'popupId',
'aria-expanded': String(this.properties.expanded),
'aria-haspopup': 'true',
id: 'buttonId',
onclick: this._togglePopup
}, [ 'Click to open popup' ]) Since this example uses a For those times, this handy checklist is a good starting point for planning a soon-to-be accessible widget:
|
V2: Philosophy & ApproachDojo 2 is grounded in the belief that accessibility is as important online as it is in our built environments, and architects of both share a similar responsibility to provide access to all. Accessibility failures abound in each setting, and they can be very obvious once one starts looking:
Web developers have an additional hurdle to jump over, since accessibility failures online are often invisible and silent. Without proper testing, it is all too easy to add a The advances in spec and support for ARIA attributes are fantastic, but they can feed into the false impression that accessibility is achieved by slapping an Using Dojo 2 WidgetsAll widgets provided through Below is a list of widgets in LabelAll form widgets apart from The A TextInput and TextareaAs with all basic form controls included in A11y properties
ButtonThis widget returns a simple A11y properties
CheckboxThe Checkbox widget wraps a native Checkbox can also be used as a toggle switch with optional A11y properties
RadioRadio creates a single wrapped A11y properties
SliderA native range slider offers limited visual customization, so the Dojo Slider widget creates an invisible native The current value is wrapped in an A11y properties
SelectSelect is the only Dojo form widget that makes use of a fully custom solution. Since it is impossible to fully customize ARIA attributes are used to associate the button with the listbox and focused option. They are also used to provide semantics for read-only and disabled options, as well as setting the entire select field to be read-only, invalid, or required. It is also possible to use Select to create a widget using the native Keyboard Interaction
Disabled options are focusable but not selectable within the listbox, per WAI-ARIA recommendations. A11y properties
ComboBoxComboBox is similar to select, but provides a text input that filters available options in addition to a button that opens the option menu. The markup is similar in that the menu comprises of a listbox of options with Since both the button that opens the options menu and the button that clears the textbox value rely on icons, hidden screen reader-accessible text is also provided. Focus is programatically returned to the text input when the clear text button is pressed or when the dropdown is opened. Keyboard Interaction
A11y properties
TimePickerTimePicker wraps the ComboBox widget, so all keyboard interactions and a11y properties are the same across both widgets. The only difference is TimePicker also provides a native CalendarThe Calendar widget renders a date grid with dropdown month and year pickers. Both the month and year dropdowns use a popup button, and control focus between the button and popup when opened and closed. Focusable items in hidden popups are removed from the focus order. The date grid itself uses a Keyboard InteractionItems in the focus order for this widget in its initial state are the buttons for the month and year pickers, the currently focused date, and the previous and next month buttons. The following keyboard interactions are available when focus is within the date grid:
When the focused date moves to a day in the next or previous month, the date grid will refresh. A11y properties
DialogThe Dialog widget creates a controlled dialog element. Controlled focus is not yet implemented, but will be added along with the focus manager. A11y properties
SlidePaneSlidePane is similar to dialog in that it creates a modal that overlays page content. It will need similar programmatic focus control, pending completion of the focus manager. A11y properties
TabControllerTabController creates a set of tabs that control the content of a container. The tabs use Keyboard Interaction
TitlePaneTitlePane creates an accordion widget, functionally a button that expands a content container. Collapsed content is obscured with A11y properties
This overview only touched on properties that primarily exist for accessibility-related reasons, but any design decision or property change will end up affecting accessibility in some way. For some of those, such as StylingThe base Dojo 2 theme meets WCAG AA color contrast guidelines, but it is up to the user to double check the final styles as changes to font size or background could affect readability. Widget css packaged with Dojo2 also includes There is a set of base styles provided by import * as css from ‘path/to/your/css’;
import * as baseCss from ‘@dojo/widgets/common/styles/base.m.css’;
@theme(css)
class MyWidget extends WidgetBase {
render() {
return v(‘div’, {
classes: this.classes().fixed(baseCss.visuallyHidden)
}, [ ‘Screen reader instructions’ ]);
}
} Focus ManagementDojo 2 will provide a focus manager for situations where focus needs to be directly managed, since directly touching the DOM within widgets is discouraged. This feature is currently in development. Writing Custom WidgetsAll DOM attributes can be set with v('button', {
key: 'buttonKey',
'aria-controls': 'popupId',
'aria-expanded': String(this.properties.expanded),
'aria-haspopup': 'true',
id: 'buttonId',
onclick: this._togglePopup
}, [ 'Click to open popup' ]) Since this example uses a For those times, this handy checklist is a good starting point for planning a soon-to-be accessible widget:
|
No description provided.
The text was updated successfully, but these errors were encountered: