Styling forms
accessibly
Styling forms
accessibly
The inclusive practice
of removing barriers
that prevent interaction with, or access to websites,
by people with disabilities.
Most studies find that
about one fifth (20%) of the population has some
kind of disability.
Visual
Motor
Auditory
Cognitive
Visual
blindness, low vision,
color-blindness
Motor
inability to use a mouse, slow response time,
limited fine motor control
Auditory
deafness,
hard-of-hearing
Cognitive
learning disabilities,
inability to remember or focus on large amounts
of information
Building for accessibility creates better
user experiences.
How it feels
Implementation
Beyond the basics
Who it benefits
Small percentage
of users?
Small percentage
of users?
Over half of the TeleCaption decoders are actually sold to the hearing population
Makes it accessible to the hearing impaired
Who it benefits
Implementation
Beyond the basics
How it feels
What are accessibility features that we should
be aware of?
Makes it easier for
people with motor disabilities.
As well as people who don't.
tab
↑↓←→ to choose option for radio button
space
enter
↑↓←→ and type to choose in a dropdown popup, and select with
Makes it usable for
blind users and users with low-mobility.
Makes it more efficient
for those who aren’t.
Who it benefits
How it feels
Beyond the basics
Implementation
Semantic HTML is a way
of writing HTML that emphasizes the meaning
of the encoded information
<h1>
<p>
<label>
<input>
<select>
Accessibility is baked in when we begin with semantic HTML.
<form>
<label for="name">Name:</label>
<input name="name" id="name">
<label for="food">Choose a food:</label>
<select name="food" id="food">
<option selected disabled>--</option>
<option>Apples</option>
<option>Coconuts</option>
<option>Chocolate</option>
</select>
<input type="submit" value="Send">
</form>
Pro: native implementations
Pro: native implementations
Con: customization limits
What can we do if the browser doesn’t let us override default styles?
Workarounds
Don’t fight the browser!
Relying on placeholders
.hide {
display: none;
}
.hide {
position: absolute;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
}
.is-hidden {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
}
Focus styles
Who it benefits
How it feels
Implementation
Beyond the basics
What other ways can we help out our users?
Label text is 18px and bold
Is that okay?
Hire us link also fails
Thank you :)