CSS layouts are modern now. You can use CSS Grid and HTML5! Inspect these semantic layouts in DevTools and screen readers. Play with the rotor/elements list, heading navigation,
@@ -55,6 +52,6 @@ const SemanticsPage = () => (
)
-export default SemanticsPage
+export default LayoutPage
diff --git a/src/pages/semantics.jsx b/src/pages/semantics.jsx
new file mode 100644
index 0000000..ee4a255
--- /dev/null
+++ b/src/pages/semantics.jsx
@@ -0,0 +1,17 @@
+import React from "react"
+
+import Layout from '../components/site-chrome/layout'
+import SEO from '../components/site-chrome/seo'
+
+const SemanticsPage = () => (
+
+
+
+
+
+
+)
+
+export default SemanticsPage
+
+
diff --git a/src/slides/index.mdx b/src/slides/index.mdx
index d1f1ffa..13d0f7b 100644
--- a/src/slides/index.mdx
+++ b/src/slides/index.mdx
@@ -5,7 +5,6 @@ import ImageSlide from "../templates/image-slide"
import CodeBlock from "../components/site-chrome/code-figure"
import AccessibleAnimationDemo from "../components/better/animation"
import Autocomplete from "../components/better/downshift-autocomplete"
-import Dropdown from "../components/better/dropdown"
import baseTheme from '../theme'
export const themes = [baseTheme, highlight]
@@ -101,7 +100,7 @@ http://bit.ly/microsoft-inclusive-toolkit
- Built with Gatsby and React
- MDX for components in Markdown
- Outputs HTML pages by default
-- Includes these slides
+- Includes this slide deck
```css
-.visuallyhidden {
+.visually-hidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
@@ -322,7 +326,7 @@ $ gatsby build && gatsby serve
Uses platform Accessibility APIs to communicate page
structure & content to assistive technologies
-
+
@@ -334,7 +338,7 @@ Uses platform Accessibility APIs to communicate page
structure & content t
Semantic markup and CSS styles impact the accessibility tree
-
+
@@ -350,7 +354,6 @@ Semantic markup and CSS styles impact the accessibility tree
document.body.addEventListener('focusin', (event) => {
console.log(document.activeElement)
})
-
```
@@ -359,10 +362,20 @@ document.body.addEventListener('focusin', (event) => {
+# Safari, y u no focus?
+
+
+
+
+
+---
+
+
+
# Exercise 1
## Test pages with the keyboard
-
+
@@ -413,11 +426,11 @@ Cheat sheets for getting started
# Exercise 4
## Screen reader testing
-- OSX Voiceover
-- NVDA and Firefox
+- OSX Voiceover and Safari
+- NVDA and Firefox Windows
- JAWS and IE11 or Edge
- iOS Voiceover and Safari
-- Android TalkBack and Chrome
+- Android Accessibility and Chrome
- Orca on Linux
@@ -431,7 +444,7 @@ Cheat sheets for getting started
- Browser zoom (all the way: 500%!)
- OS-level zoom
-- ZoomText & other apps
+- ZoomText & other assistive tech
@@ -726,7 +739,7 @@ Useful for so many people and situations, but often turned off for everyone
```css
:hover, :focus {
/* interaction styles here */
- outline: 3px solid blue;
+ outline: 5px auto blue;
}
```
@@ -740,7 +753,7 @@ Useful for so many people and situations, but often turned off for everyone
-# Styling focus
+# Styling input modalities
@@ -814,10 +827,31 @@ const Layout = () => (
+# Dropdown Demo
+
+http://localhost:8000/dropdown
+
+
+
+---
+
+
+
# Exercise
-## Dropdown demo
+## Create an accessible dropdown
+
+- React component shell: [dropdown.js](https://github.com/marcysutton/js-a11y-workshop/blob/master/src/components/better/dropdown.js)
+- vanilla.js shell: https://codepen.io/marcysutton/pen/aeJdNq
-- React: https://marcysutton.github.io/js-a11y-workshop/dropdown
+
+
+---
+
+
+
+# Dropdown answers
+
+- React: [dropdown component](https://github.com/marcysutton/js-a11y-workshop/blob/master/examples/dropdown/dropdown.js)
- vanilla.js: https://codepen.io/marcysutton/pen/JgjYVv
@@ -830,7 +864,7 @@ const Layout = () => (
Navigation where JavaScript controls browser history
and dynamically maps URLs to each page or view
-
+
[User testing research on the Gatsby blog](https://www.gatsbyjs.org/blog/2019-07-11-user-testing-accessible-client-routing/)
@@ -846,7 +880,7 @@ Navigation where JavaScript controls browser history
and dynamically maps U
- Label with nearby content and what action it does,
e.g. "Portfolio, skip to navigation"
- When a user clicks a nav link, move focus to this control
-
+
@@ -869,11 +903,32 @@ Navigation where JavaScript controls browser history
and dynamically maps U
+# Client-side routing demo
+
+http://localhost:8000
+
+
+
+---
+
+
+
# Exercise
-## Client-side routing demo
+## Focus on client-side route change
-- React:
-- vanilla.js:
+- Gatsby [`onRouteUpdate` method](https://www.gatsbyjs.org/docs/browser-apis/#onRouteUpdate)
+- vanilla.js shell: []()
+
+
+
+---
+
+
+
+# Client-side routing answers
+
+- Gatsby component: [examples/client-side-routing](https://github.com/marcysutton/js-a11y-workshop/tree/master/examples/client-side-routing)
+- vanilla.js: []()
@@ -883,7 +938,7 @@ Navigation where JavaScript controls browser history
and dynamically maps U
# Announcements using
ARIA Live Regions
-
+
@@ -965,10 +1020,31 @@ https://github.com/AlmeroSteyn/react-aria-live
+# Live region demo
+
+http://localhost:8000/async-form
+
+
+
+---
+
+
+
# Exercise
-## Async action demo
+## Build a live region
+
+- vanilla.js shell: []()
+
+
+
+---
+
+
+
+# Live region answers
-https://marcysutton.github.io/js-a11y-workshop/async-form
+- React component: [examples/live-region](https://github.com/marcysutton/js-a11y-workshop/tree/master/examples/live-region)
+- vanilla.js: []()
@@ -1003,7 +1079,7 @@ Semantic HTML communicates what's on a page to users of assistive technology, re
# Semantics IRL
-
+
---
@@ -1024,11 +1100,21 @@ Semantic HTML communicates what's on a page to users of assistive technology, re
-# Exercise!
+# Semantics demo
+
+http://localhost:8000/layout
+
+
-## Semantics demo
+---
-https://marcysutton.github.io/js-a11y-workshop/layout
+
+
+# Exercise
+## Use semantic markup
+
+- Gatsby page shell: [pages/semantics.jsx](https://github.com/marcysutton/js-a11y-workshop/tree/master/pages/semantics.jsx)
+- vanilla.js shell on [Codepen]()
@@ -1101,6 +1187,16 @@ handleReduceMotionChanged(); // trigger once on load
[WebKit guide](https://webkit.org/blog/7551/responsive-design-for-motion/) ~ [MDN docs](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion)
+
+
+---
+
+
+
+# reduced-motion demo
+
+http://localhost:8000/animation
+
---
@@ -1109,9 +1205,21 @@ handleReduceMotionChanged(); // trigger once on load
# Exercise!
-## Play with reduced-motion
and CSS animation or transitions
+Play with reduced-motion and CSS animation or transitions
-https://marcysutton.github.io/js-a11y-workshop/animation
+- React component shell: [reduced-motion.js](https://github.com/marcysutton/js-a11y-workshop/blob/master/src/components/better/reduced-motion.js)
+- vanilla.js shell: []()
+
+
+
+---
+
+
+
+# Reduced-motion answers
+
+- React: [animation component](https://github.com/marcysutton/js-a11y-workshop/blob/master/examples/reduced-motion/animation.js)
+- vanilla.js: https://codepen.io/marcysutton/pen/JgjYVv
@@ -1196,13 +1304,33 @@ export default AccessibleList
+# Progressive enhancement demo
+
+http://localhost:8000/enhanced-tablist
+
+
+
+---
+
+
+
# Exercise!
Play with progressive enhancement
-https://codepen.io/marcysutton/pen/WBvRxq
+- React component shell: [components/tab-list.js](https://github.com/marcysutton/js-a11y-workshop/blob/master/src/components/tab-list.js)
+- vanilla.js starter: https://codepen.io/marcysutton/pen/WBvRxq
-https://marcysutton.github.io/js-a11y-workshop/enhanced-tablist
+
+
+---
+
+
+
+# Progressive enhancement
answers
+
+- React: [tab-list component](https://github.com/marcysutton/js-a11y-workshop/blob/master/examples/progressive-enhancement/tab-list.js)
+- vanilla.js: https://codepen.io/marcysutton/pen/oKBzdr
@@ -1284,11 +1412,9 @@ Article: [Writing Automated tests for Accessibility](https://www.deque.com/blog/
-# Unit test example
+# Unit test demo
-Modal dialog with Jasmine tests
-
-https://codepen.io/marcysutton/pen/YbXZYK?editors=1010
+- Dropdown with Jest: [\__tests\__](https://github.com/marcysutton/js-a11y-workshop/tree/master/src/components/better/__tests__)
@@ -1300,7 +1426,21 @@ https://codepen.io/marcysutton/pen/YbXZYK?editors=1010
Write an accessibility unit test!
-[Test example](https://github.com/marcysutton/js-a11y-workshop/tree/master/src/components/better/__tests__)
+- Jest test shell: [dropdown.test.js](https://github.com/marcysutton/js-a11y-workshop/tree/master/src/components/better/__tests__/dropdown.test.js)
+- Jasmine shell: https://codepen.io/marcysutton/pen/OKpVKZ?editors=1010
+- https://testing-library.com/docs/dom-testing-library
+- https://github.com/testing-library/jest-dom
+
+
+
+---
+
+
+
+# Unit testing answers
+
+- Jest test: [dropdown.test.js](https://github.com/marcysutton/js-a11y-workshop/tree/master/examples/unit-testing/dropdown.test.js)
+- Jasmine test: [Modal dialog](https://codepen.io/marcysutton/pen/YbXZYK?editors=1010)
@@ -1333,35 +1473,6 @@ Write an accessibility unit test!
-# [Cypress example](https://github.com/marcysutton/empathy-driven-development/blob/master/cypress/integration/nav.spec.js)
-
-
-
-```js
-context("Nav menu", () => {
- beforeEach(() => {
- cy.visit(`https://marcysutton.github.io/js-a11y-workshop`)
- cy.injectAxe()
- cy.wait(100)
- })
- it("has no accessibility violations on load", () => {
- cy.checkA11y()
- })
- it("has a focusable, labeled button", () => {
- cy.get("[aria-label='Open menu']").focus()
- cy.focused().should("have.attr", "aria-label")
- })
-})
-```
-
-
-
-
-
----
-
-
-
# [Selenium Webdriverjs example](https://github.com/marcysutton/axe-webdriverjs-demo)
@@ -1396,6 +1507,35 @@ describe('Keyboard tests', () => {
+# [Cypress example](https://www.gatsbyjs.org/docs/end-to-end-testing/)
+
+
+
+```js
+///
+describe("Accessibility checks", () => {
+ beforeEach(() => {
+ cy.visit("/")
+ cy.wait(500)
+ })
+ it("Checks if footer link is focusable and has the correct attributes", () => {
+ cy.getAllByText("Gatsby").focus()
+ cy.focused()
+ .should("have.text", "Gatsby")
+ .should("have.attr", "href", "https://www.gatsbyjs.org")
+ .should("not.have.css", "outline-width", "0px")
+ })
+})
+```
+
+
+
+
+
+---
+
+
+
# _No matter what kind of test:
focus on the outcome,
not the code implementation_ ✨
@@ -1450,11 +1590,32 @@ Tests can catch roughly 30-50% of accessibility issues,
depending on the ru
+# Integration test demo
+
+[cypress/integration/index.js](https://github.com/marcysutton/js-a11y-workshop/blob/master/cypress/integration/index.js)
+
+
+
+---
+
+
+
# Exercise!
Write an end-to-end accessibility test for
keyboard interactions and/or with an accessibility test API
-[Test example](https://github.com/marcysutton/js-a11y-workshop/tree/master/cypress/integration)
+- Cypress test shell: [index.js](https://github.com/marcysutton/js-a11y-workshop/blob/master/cypress/integration/index.js)
+- Cypress API docs: https://cypress.io
+
+
+
+---
+
+
+
+# Integration test answers
+
+- Cypress tests: [examples/integration-testing](https://github.com/marcysutton/js-a11y-workshop/blob/master/examples/integration-testing)
@@ -1479,7 +1640,7 @@ https://twitter.com/zqxwzq/status/868039653697482753
-
+
diff --git a/src/templates/slide.jsx b/src/templates/slide.jsx
index d6478e1..be42968 100644
--- a/src/templates/slide.jsx
+++ b/src/templates/slide.jsx
@@ -67,7 +67,7 @@ const FooterByline = styled.p`
export default ({ children }) => (
<>
-