<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marcus Herrmann</title>
    <description>The latest articles on DEV Community by Marcus Herrmann (@marcush).</description>
    <link>https://dev.to/marcush</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F127911%2Fa3c16059-c9aa-4590-8990-ab7b1b2104ae.jpg</url>
      <title>DEV Community: Marcus Herrmann</title>
      <link>https://dev.to/marcush</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marcush"/>
    <language>en</language>
    <item>
      <title>Accessible Overflow</title>
      <dc:creator>Marcus Herrmann</dc:creator>
      <pubDate>Thu, 08 Jul 2021 05:49:43 +0000</pubDate>
      <link>https://dev.to/marcush/accessible-overflow-2l4</link>
      <guid>https://dev.to/marcush/accessible-overflow-2l4</guid>
      <description>&lt;p&gt;One major tenet of web accessibility is that users have various strategies to operate your website. While still too many web developers aren't able to name input modes beyond pointer devices (mouse and touch), properly covering keyboard accessibility will get you the most bang for your buck. If you ensure that all the features of your site can be operated with a defined collection of keys (tab key, space bar, enter key, arrow keys, etc) you largely increased the likelihood that people with all kinds of strategies and assistive technologies are able to use the site you built.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rock'n'Scroll
&lt;/h2&gt;

&lt;p&gt;"Navigating a website" can, of course, mean jumping from interactive control to interactive control but most forms of interactions come down to reading or passively experiencing your content. A central way to do that is of course scrolling. It's obvious that mouse owners can use the scrollbar or a particular mouse wheel and touch users drag the site up or down. But I think the strategy keyboard-only users employ for scrolling is known far beyond this user group: using your keyboard's arrow keys (or is it just me, especially when reading long texts on the Desktop?).&lt;/p&gt;

&lt;p&gt;Anyway, arrow keys scroll the overall website, regardless of the focus's precise position, and sometimes, this is all you need. But what about particular containers that harbour content that is either horizontally or vertically too large for its parent? It is allowed to overflow, more often than not with the CSS &lt;code&gt;overflow: auto&lt;/code&gt;. Alas, the situation around keyboard accessibility of these containers is patchy, and I only completly realized this &lt;em&gt;after&lt;/em&gt; a current customer project which had an overflowing container. So, what follows is my little research on the topic and the current state of overflow scrolling afairs (see original sources at the bottom of the article).&lt;/p&gt;

&lt;h2&gt;
  
  
  Overflow and Focus
&lt;/h2&gt;

&lt;p&gt;Firefox, for example, puts an overflowing container into the tab order, making it reachable and its content scrollable. Because it has no focus styles, it is not really obvious that it has focus, though, but web developers can at least write a CSS selector like &lt;code&gt;.my-overflowing-div:focus&lt;/code&gt; to make its state more clear to friends of the Mozilla. However, the situation in Chrome, Chrome-based Edge and Safari is different. Without any changes in the HTML, overflowing content is not scrollable with the keyboard (unless, of course, there is an interactive element inside the container - but this scrolling doesn't uncover every part of the container).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;All interactive should be focusable&lt;br&gt;
&lt;cite&gt;&lt;a href="https://www.w3.org/TR/wai-aria-1.0/usage#managingfocus_header"&gt;(Using WAI-ARIA)&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Ensuring a coherent experience across browsers
&lt;/h2&gt;

&lt;p&gt;The Webkit and Blink team are aware of this topic insofar that issues related to that exist for 3 or 5 years, respectively (&lt;a href="https://bugs.webkit.org/show_bug.cgi?id=190870"&gt;Webkit Issue # 585413&lt;/a&gt; and &lt;a href="https://bugs.chromium.org/p/chromium/issues/detail?id=584618"&gt;Chrome's one even is on "Intent to ship" since 2.5 years&lt;/a&gt;). Unfortunately, there is nothing tangible beside the tickets, so web developers must apply a hack if they want to convey Firefox's behaviour to all browsers. This workaround, or "hack" as Adrian Roselli calls it, comes from Steve Faulkner and consists of three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add &lt;code&gt;tabindex="0"&lt;/code&gt; to the overflowing container to make it baseline keyboard accessible.&lt;/li&gt;
&lt;li&gt;Show this keyboard accessibility to users by applying custom focus styles: &lt;code&gt;.my-owerflowing-div:focus { outline: 2px solid; }&lt;/code&gt; (if you want to be both future-proof when it comes to WCAG and an overall good web author citizen, &lt;a href="https://www.w3.org/WAI/standards-guidelines/wcag/new-in-22/#2411-focus-appearance-minimum-aa"&gt;take care of focus style contrasts&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;"Promote" the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; to a landmark region by both applying &lt;code&gt;role="region"&lt;/code&gt; &lt;strong&gt;and&lt;/strong&gt; supplying an accessible name, by using &lt;code&gt;aria-label&lt;/code&gt;, for example. By doing so, you provide much-needed context to screen reader users - because they suddenly discover a focussable element that is not interactive in the classic sense (like a link or button would be).&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Demos and Links
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/stevef/embed/JGaoob?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codepen.io/stevef/pen/JGaoob"&gt;Steve Faulkner provided the code mentioned above combined into a CodePen&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;More than five years ago, he published &lt;a href="https://www.tpgi.com/short-note-on-improving-usability-of-scrollable-regions/"&gt;Short note on improving usability of scrollable regions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;As for every web accessibility topic, Adrian Roselli has a deep dive article: &lt;a href="https://adrianroselli.com/2016/02/keyboard-and-overflow.html"&gt;Keyboard and Overflow&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>a11y</category>
    </item>
    <item>
      <title>Twenty inclusive strategies for building web apps in 2020</title>
      <dc:creator>Marcus Herrmann</dc:creator>
      <pubDate>Thu, 19 Dec 2019 08:19:02 +0000</pubDate>
      <link>https://dev.to/marcush/twenty-inclusive-strategies-for-building-web-apps-in-2020-b41</link>
      <guid>https://dev.to/marcush/twenty-inclusive-strategies-for-building-web-apps-in-2020-b41</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="https://marcus.io/blog/20-web-app-strategies-2020"&gt;marcus.io&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;With the start of the new year, it is a good opportunity to look into the accessibility of your web app. &lt;strong&gt;Here are 20 starting points to make your web app more inclusive in 2020.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Covering the basics is 90% of the way of making your web app accessible!&lt;/strong&gt; Yes, there are special accessibility problems that have to do with how web apps work, but it is valid to say: If you concentrate on &lt;a href="https://www.w3.org/WAI/tips/developing/"&gt;the basics of building an inclusive web &lt;em&gt;document&lt;/em&gt;&lt;/a&gt; you'll take care of the huge majority of web app accessibility problems. And, tackle them first: Because what's the use of sophisticated focus management on route transition for example, when non-visual users can't really find the main navigation in the first place?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use the power of CSS feature queries like prefers-reduced-motion, and additionally offer the setting to disable animations.&lt;/strong&gt; For some people, animations on the web can not only be annoying but actually harmful (&lt;a href="https://a11yproject.com/posts/understanding-vestibular-disorders/"&gt;see A11yProject's "Understanding vestibular disorders"&lt;/a&gt;). Fortunately, these users can now enable a setting in their operating system that they opt out of potential seizure triggering animations, and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion"&gt;us developers can detect this setting&lt;/a&gt;. But regardless of the OS's ability to submit a prefers-reduced-motion preference: Use the power of your web app's state to implement a setting like this (&lt;a href="https://accessible-app.com/pattern/vue/responsible-animation"&gt;here's an example how you could do this in Vue.js&lt;/a&gt;). A good real-life example is the new twitter web app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test your apps loading/interstitial states with screen readers.&lt;/strong&gt; A frequent feature of a web-app is to load data asynchronously, e.g. from an internal or external API or database. This leads to loading states that you, I assume, convey visually with nicely animated progress bars. But I invite you to check your app, and especially these in-between states with a screen reader: Is it clear what happens or does the screen reader just stays silent for an indeterminate amount of time? If so, I'd suggest you inform yourself if &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions"&gt;ARIA live regions&lt;/a&gt; can help (&lt;a href="https://accessible-app.com/pattern/vue/notifications"&gt;read the "accessible notifications" pattern on Accessible App&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add &lt;a href="https://www.npmjs.com/package/axe-core"&gt;axe core&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/pa11y-ci"&gt;pa11y-ci&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/tenon-cli"&gt;tenon-cli&lt;/a&gt; or the like to your tooling/tests infrastructure&lt;/strong&gt;. With most web app comes a complex tooling setup in order to a development server, build your app and run tests. While this makes web app development rather complex, it gives you the opportunity to write and run tests, especially for accessibility. Note: only about 20-30% of accessibility issues are testable automatically, and there are sometimes false negatives – but in overall, having accessibility-related test coverage does no harm, especially when it comes to educating other team members working on the same project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make sure that your whole app, especially the custom elements, are keyboard accessible.&lt;/strong&gt; Keyboard accessibility is crucial to inclusive interface design. Many developers are not aware of the multitude of possibilities and strategies people have to use websites – and in that regard, how important keyboard accessibility really is. When speaking about custom elements, and first, make sure that this particular form of input really cannot be solved with a native input element (since it offers extraordinary amounts of inbuilt accessibility features). If this isn't feasible, take a look into the &lt;a href="https://www.w3.org/TR/wai-aria-practices-1.1/"&gt;WAI-ARIA Authoring Practices&lt;/a&gt; (but also read the next item of this list).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Be aware that WAI-ARIA Authoring Practices (AP) aren't gospel or standards.&lt;/strong&gt; When you first stumble upon the authoring practices of W3C's Web Accessibility Initiative, and you care about the inclusive web, you possibly sigh in relief. "Finally", you may think, "a resource how to build accessible custom controls with modern JavaScript and ARIA." While this is true in part - the authoring practices show how ARIA &lt;em&gt;should&lt;/em&gt; be used, have in mind that some AP are disputed: Because of the concepts, because of an accidental exclusion of other users, or because of inconsistencies in assistive technologies. As a general rule of thumb, &lt;a href="https://github.com/w3c/aria-practices/issues"&gt;look into the discussions in the Authoring Practices Github issues&lt;/a&gt; and see if there is a discussion around the practice you are aiming to implement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check your framework for accessibility documentation.&lt;/strong&gt; Some of the major JavaScript frameworks helping you to build web applications have a whole section on inclusivity in their official documentation (&lt;a href="https://reactjs.org/docs/accessibility.html"&gt;React, for example&lt;/a&gt;). Study these resources thoroughly. There may be some gems hidden stating how you can implement accessible solutions in this particular framework with its feature and strengths. Also, if your favourite framework not yet has such a section in its official docs, but you are an accessibility specialist (or have some track record in another framework), think of contributing (and adapting) what you have learned so far. After all, it is open source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Follow "accessibility people" of your framework.&lt;/strong&gt; By circumstance, or by design (?), oftentimes people very involved in communities surface as "thought leaders", or at least "representatives" of certain sub-topics in your framework of choice. I bet there are people specialising in accessibility and worth following (e.g. on social media, or via their blog RSS-feed) in every framework. Do just that, keep up to date with your libraries' features that possibly could help everyone implementing accessibility with it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check clickable elements outside of forms – are they links or buttons?&lt;/strong&gt; In modern JavaScript, it is so easy to make elements clickable (actually, it was easy in un-modern JavaScript before, &lt;em&gt;cough&lt;/em&gt; onClick attribute, &lt;em&gt;cough&lt;/em&gt;). But in accessibility terms, a (let's say) clickable &lt;span&gt; does not make any sense and is actually harmful. There are many good articles out there explaining this over and over (&lt;a href="https://karlgroves.com/2013/05/14/links-are-not-buttons-neither-are-divs-and-spans"&gt;like this article from Karl Groves&lt;/a&gt;), so I'm not trying to add another piece of content. Rather, I'd like to emphasize that is important to know when to use a link (generally speaking: for changes of location in your app) and when to use a button (generally speaking: to change the state of your app or to hide/show things). &lt;a href="https://marcysutton.com/talk/smashing-conf-sf-the-links-vs-buttons-showdown"&gt;Marcy Sutton's talk "The Links vs. Buttons Showdown"&lt;/a&gt; is a great resource on this.&lt;/span&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check if infinite scroll could be solved more accessible.&lt;/strong&gt; Infinite scrolling, or virtual scrolling, is both very common in apps (think of: Twitter's ever-changing, self-updating and never-ending timeline) but also a very common accessibility problem. And while role="feed" informs screen reader users of a widget's dynamic and updating nature, infinite feeds are still a problem for other groups, for example keyboard-only, switch device or speech recognition users. I recommend checking Raghavendra Satish Peri's article &lt;a href="https://www.deque.com/blog/infinite-scrolling-rolefeed-accessibility-issues/"&gt;"Infinite Scrolling &amp;amp; Role=Feed Accessibility Issues"&lt;/a&gt; – and also his suggestion to solve most of the problems, and whether this is a good fit for your projects that have infinitely scrolling parts.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;If your web app enables people to create content – check if you can help them make it more accessible.&lt;/strong&gt; Now, this is a topic that can't be summarized in a paragraph, since features for content creating come in different shapes and sizes. But the important bits are: make sure that both user-generated content and the way to user-generated content is accessible. And that there is &lt;del&gt;an app&lt;/del&gt; a standard for that: &lt;a href="https://www.w3.org/WAI/standards-guidelines/atag/"&gt;The Authoring Tools Accessibility Guidelines&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check if it uses just the right amount of ARIA.&lt;/strong&gt; For some people WAI-ARIA is the solution for all accessibility problems, adds functionality just by using it or see it as some form of miracle worker. Just add it to your web-app, and it will automagically make it more accessible. Alas, that could not be further from the truth. In reality, ARIA is a specification especially for assistive technology and in some regards, "a polyfill HTML". It helps developers to build or retrofit custom widgets in a way that screen-reader, for example, have the chance to understand them. First and foremost, WAI-ARIA is a contract with the user about adhering to certain usage patterns and to advertise that certain keyboard usage patterns are implemented. I think this general misunderstanding leads to findings like the analysis of the WebAim Million that uncovered that the &lt;em&gt;more&lt;/em&gt; ARIA is used, the &lt;em&gt;less&lt;/em&gt; accessible one website is. Or, &lt;a href="https://twitter.com/brucel/status/1206622748371554305"&gt;as Bruce Lawson puts it&lt;/a&gt;: "...unless you really really know what you're doing, it's easy to make things worse with ARIA." So why the WebAim Million result is the way it is, is not hard to imagine, having this central misunderstanding in mind. Don't fall into this trap when building your web app!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Test your app with people with disabilities!&lt;/strong&gt; Adhering to standards, being dogmatic and building things academically correct is just one part of the puzzle (alas, this aspect alone is often neglected). The other essential part is to talk with your users, test our assumptions and – ideally – ask people with disabilities in order to find out if your app (or any digital project in that regards) is really **built in an inclusive way.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;If you want to use a web UI framework, check its accessibility.&lt;/strong&gt; Sometimes is recreating everything from scratch is not the most economical option for your project and you reach out for established web UI frameworks like Foundation, Bootstrap, Material UI or Uikit. But bear in mind that it is important to have an idea of how accessible that UI framework actually is, and if it helps or hinders you when making your app more accessible. For help with that, research what's written about the accessibility of your chosen framework, or read articles like &lt;a href="https://darekkay.com/blog/accessible-ui-frameworks/"&gt;"The state of accessible web UI frameworks" from Derek Kay&lt;/a&gt;, who used a methodical approach in reviewing 20+ UI frameworks in regards to their accessibility features.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keep updated regarding the Accessibility Object Model (AOM).&lt;/strong&gt; The AOM will be an API to allow developers to modify and convey semantics to the accessibility tree, without having to rely on HTML (Reminder: the accessibility tree is a representation for the DOM tree for assistive technologies like screen readers or speech recognition software). To quote &lt;a href="https://hiddedevries.nl/en/blog/2019-07-22-meaning-without-markup-accessibility-object-model"&gt;Hidde de Vries&lt;/a&gt;: "With direct access to accessibility info, we could set accessibility properties without markup, we could create accessibility trees for things that don’t exist in the DOM (like for contents of canvas elements), and testing accessibility may improve." Although both proposals and browser implementations of the Accessibility Object Model are still in "work in progress" state, it is very much worth following its development. To do that I would suggest following publications, tweets and talks from Leonie Watson (&lt;a href="//notion://www.notion.so/marcusherrmann/tink.uk/"&gt;Blog&lt;/a&gt;, &lt;a href="https://twitter.com/LeonieWatson"&gt;Twitter&lt;/a&gt;) and aforementioned Hidde (&lt;a href="https://hiddedevries.nl/en"&gt;Blog&lt;/a&gt;, &lt;a href="https://twitter.com/hdv"&gt;Twitter&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Look into the advantages modern JavaScript frameworks can bring.&lt;/strong&gt; It's not always black and white, especially when it comes to accessibility. Still, frameworks have a bad reputation in that regard. But it is much more exciting to think about how to use their undeniable powers – so to speak – for a good cause. In 2019, a whole bunch of people helped my to collect a list of ideas, resources, keywords and starting points answering the question: &lt;a href="https://marcus.io/blog/using-framework-powers-for-good"&gt;"In what ways could React, Vue, Angular and Co and their features actually facilitate inclusive designs?&lt;/a&gt;"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;InFORM yourself about screen reader's form mode:&lt;/strong&gt; The big screen readers for Windows operating system, namely NVDA and JAWS have special modes they switch into and offer interaction patterns that match that mode or circumstance. There is the browser mode, the so-called application mode, and something like the form mode. Since web apps predominantly consist of some kind of form input controls or collections of forms, it is well worth to look into the latter. Generally speaking screen reader users in form mode can only navigate to focusable element – and you have to keep this in mind, especially when dealing with input labels, descriptions, errors and their respective programmatic associations. My suggestion to dive into this topic: Accessibility Developer Guide's &lt;a href="https://www.accessibility-developer-guide.com/knowledge/desktop-screen-readers/browse-focus-modes/"&gt;"Screen reader browse and focus modes"&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check if the usage pattern of your custom components follow established patterns like modal or disclosure&lt;/strong&gt;. In his book &lt;a href="https://www.smashingmagazine.com/ebooks/apps-for-all-coding-accessible-web-applications/"&gt;"Apps for All"&lt;/a&gt;, Heydon Pickering writes: "Looking at JavaScript-driven web interfaces, by far the most common interaction style is based on showing stuff or hiding it or... oh, that’s pretty much it." I invite you to take such a deep look into your interfaces and code – does one control toggle the visibility of another? In this case, it's likely that you have built some form of &lt;a href="https://en.wikipedia.org/wiki/Disclosure_widget"&gt;"disclosure widget"&lt;/a&gt;. Does another control trigger another containers visibility, and does the container try to render the rest of the interface inactive? Then this could be &lt;a href="https://www.quora.com/Whats-the-difference-between-a-modal-and-dialog"&gt;the "modal" concept&lt;/a&gt;. If patterns like these are present in your app, try to analyse the accessibility implications of both.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;If your app is not fully client-side rendered, care about progressive enhancement&lt;/strong&gt;. JavaScript is not always available. Its absence normally leads to single page applications not running at all, but not every web app is fully client rendered. Make sure that all of your content is perceivable and independent from processing through JavaScript. Andy bell uses the example of a disclosure widget to show how robust widgets can be built: &lt;a href="https://hankchizljaw.com/wrote/a-progressive-disclosure-component/"&gt;https://hankchizljaw.com/wrote/a-progressive-disclosure-component/&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;If you learn about your framework by tutorials, be critical and don't just copy and paste.&lt;/strong&gt; Many tutorial authors are not aware (or don't really care) about accessibility. This is very unfortunate, since video courses a great way of learning for many developers, and learning always starts with imitating and copying (the latter sometimes literally). What often also gets copied is the teacher's missing knowledge or disinterest in the topic of inclusive web developments. Fortunately, this appears to change (highlighting Wes Bos and Adam Wathan here), but it is still way too common. So if you are a beginner in web development (and you happen to read the whole way through this article, which is great in itself! 🎉), be on your guard.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it for my – I guess – last blog post of the year. Though I barely scratched the surface on each and every on this topics, I hope the list above gives you new ideas, keywords, or starting points for your learning. With this in mind: May 2020 be the year of improved accessibility on the web!&lt;/p&gt;

</description>
      <category>webapp</category>
      <category>a11y</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Fata Morganas in Accessibility</title>
      <dc:creator>Marcus Herrmann</dc:creator>
      <pubDate>Mon, 28 Oct 2019 16:36:12 +0000</pubDate>
      <link>https://dev.to/marcush/fata-morganas-in-accessibility-5gk9</link>
      <guid>https://dev.to/marcush/fata-morganas-in-accessibility-5gk9</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="https://marcus.io/blog/fata-morganas-in-a11y"&gt;marcus.io&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Sometimes you stumble over things where your first thoughts are, "Hey, thats great for accessibility!" or "Nice, it's always better to solve things in a browser-native way instead of relying on JavaScript". &lt;a href="https://marcus.io/blog/menu-or-not"&gt;And this has happened to me before&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Unfortunately, once you dive in deeper in to these, at first, perfect solutions you read more and more about their imperfections or downright disadvantages. Here are some elements, attributes or techniques that initially piqued my interest. But luckily, after that "Using &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt;/&lt;code&gt;&amp;lt;summary&amp;gt;&lt;/code&gt; for a menu" episode, I decided to do  some research before diving into the phase of building demos and excitedly writing about that new shiny a11y thing. Because sometimes these new techniques turn out to be some kind of fata morganas, or solutions that are not yet ready for prime-time.&lt;/p&gt;

&lt;h3&gt;
  
  
  No. 1: Using &lt;code&gt;aria-role="feed"&lt;/code&gt; solves accessibility issues for all users
&lt;/h3&gt;

&lt;p&gt;I was happy when I first read about the &lt;code&gt;feed&lt;/code&gt; role. To give context: It is meant to help in situations where there is infinite scrolling and a continuous stream of content (like for example Twitter's, Mastodon's or Facebook's status message list). And I wasn't alone. Quote Deque employee Raghavendra Satish Peri:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Just like many developers and the accessibility professionals, I initially believed that role=”feed” would solve any accessibility-related problems for infinite scrolling.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But the disadvantage of relying on &lt;code&gt;role="feed"&lt;/code&gt; alone to solve a feed's accessibility problem is that there are more than just screen reader users who are negatively affected by infinite scroll interfaces. Additionally, keyboard-only users, speech regocgnition software users, people using zoom, or switch devices and people with cognitive disabilities also have their problems with this pattern.&lt;/p&gt;

&lt;p&gt;Aforementioned Raghavendra Satish Peri wrote &lt;a href="https://www.deque.com/blog/infinite-scrolling-rolefeed-accessibility-issues/"&gt;an interesting article about the scope of the problem&lt;/a&gt; and the potential misunderstanding that comes with this role. Furthermore, he suggest an accessible infinite scroll design pattern, which looks promising and worth a look for everybody who plans to implement a feed of this sort themselves in the future (especially since there's no consensus on the "official" usage example by WAI-ARIA Authoring Practices).&lt;/p&gt;

&lt;h3&gt;
  
  
  No. 2: Detecting screen readers in CSS with the &lt;code&gt;speech&lt;/code&gt; media query
&lt;/h3&gt;

&lt;p&gt;If you look at it superficially, &lt;code&gt;@media speech&lt;/code&gt; seems to be a way to address screen readers via CSS, and a means to avoid &lt;code&gt;.visibility-hidden&lt;/code&gt; classes, for example. On a second, more thorough look you'll notice that &lt;a href="https://github.com/w3c/csswg-drafts/issues/1751"&gt;there is a discussion ongoing in CSS Working Group (Drafts), regarding its removal&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Because one the one hand, &lt;a href="https://github.com/w3c/csswg-drafts/issues/1751#issuecomment-390288685"&gt;it is not supported in user agents at all&lt;/a&gt; and on the other, screen readers use &lt;code&gt;screen&lt;/code&gt; media type anyway, the agreement is to add a warning regarding &lt;code&gt;@media speech&lt;/code&gt;: it "is for pure-audio UAs, &lt;strong&gt;not&lt;/strong&gt; screen readers".  So in the future it could be a way to detect Alexa, Siri or Google Home. In the present, though, it is no method to recognize screen readers.&lt;/p&gt;

&lt;p&gt;Bear in mind that even it it &lt;em&gt;would work,&lt;/em&gt; it wouldn't be a good idea to use it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There are more screen reader users than the ones who are 100% blind: Also, people who are partially sighted use these types of software, in addition to people with good eyesight but cognitive issues&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tink.uk/thoughts-on-screen-reader-detection/"&gt;You shouldn't aim to detect screen readers for ethical privacy reasons.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  No. 3: Using the &lt;code&gt;&amp;lt;dialog&amp;gt;&lt;/code&gt; element for perfectly accessible modal windows
&lt;/h3&gt;

&lt;p&gt;It's actually quite hard to build an accessible modal dialog, so &lt;code&gt;&amp;lt;dialog&amp;gt;&lt;/code&gt; appears like a gift at first. To &lt;a href="https://css-tricks.com/some-hands-on-with-the-html-dialog-element/#comment-1751844"&gt;quote Eric Bailey&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I like what dialog represents. HTML should pave the cowpaths of popular UI patterns. They should especially do this when those patterns come with tricky implementation concerns that developers may fail to consider, especially when those considerations include accessibility.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Additionally most of the time the advice – when it comes to ARIA and JavaScript in general – is: "Don't rebuild element or widgets when there is a native one at hand" (&lt;a href="https://www.w3.org/TR/using-aria/#rule1"&gt;ARIA Rule #1&lt;/a&gt;). And while this is true in most cases (like using and styling a &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; instead of trying to re-build one) this advice is out of place when it comes to the &lt;code&gt;&amp;lt;dialog&amp;gt;&lt;/code&gt; element.&lt;/p&gt;

&lt;p&gt;Admittedly, at first glance the native dialog implementation looks rather good: &lt;a href="https://css-tricks.com/some-hands-on-with-the-html-dialog-element/"&gt;It is, like Chris Coyer states, "not just a semantic element, it has APIs and special CSS"&lt;/a&gt;. It brings &lt;code&gt;.show()&lt;/code&gt;, &lt;code&gt;.showModal()&lt;/code&gt; and &lt;code&gt;.hide()&lt;/code&gt; methods (and hitting the &lt;code&gt;ESC&lt;/code&gt; key closes it), a new mode for forms, namely &lt;code&gt;method="dialog"&lt;/code&gt;. This means that in the following example, a button click would close the modal in the same way a button in a "normal" form would submit the form's data:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;form method="dialog"&amp;gt;&amp;lt;button&amp;gt;Close&amp;lt;/button&amp;gt;&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Furthermore, &lt;code&gt;&amp;lt;dialog&amp;gt;&lt;/code&gt; brings a &lt;code&gt;::backdrop&lt;/code&gt; CSS pseudo to precisely style the often darkening overlay, and it even takes care of focus management (minus implementing a focus trap when a modal is open).&lt;/p&gt;

&lt;p&gt;Sounds too good to be true? Well, it kind of is. Part of the reason for that is the well-intended focus algorithm that is built in. Unless there is an &lt;code&gt;autofocus&lt;/code&gt; attribute present in the dialog it will focus the first focusable element. But it is not granted that this element will be one of the first items in a dialog. Scott O'Hara paints in his article &lt;a href="https://www.scottohara.me/blog/2019/03/05/open-dialog.html"&gt;"Having an open dialog"&lt;/a&gt; the picture of a scenario where a dialog contains a long text, for example our most favorite internet texts (legal ones like terms of service). Would the first focusable element be at the end of this long, scrolling text a user would experience that a dialog would start in state where the content is already scrolled. Also, one important thing of dialog is focus management is still missing: the return of focus to the dialog-triggering element once it closes. So developers might think they take care of accessibility by using &lt;code&gt;&amp;lt;dialog&amp;gt;&lt;/code&gt; – but in fact need to programmatically fill these gaps.&lt;/p&gt;

&lt;p&gt;Aside from these problems Scott discovered some problems with the dialog in various screen reader and browser combinations. He concludes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;tldr; I’m just going to say right now that the dialog element and its polyfill are not suitable for use in production. And it’s been that way since the dialog’s earliest implementation in Chrome, six-ish years ago.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  No. 4: Using &lt;code&gt;aria-label&lt;/code&gt; as a means to describe everything
&lt;/h3&gt;

&lt;p&gt;Maybe you were like me: When I first heard about &lt;code&gt;aria-label&lt;/code&gt;, I thought: "Wonderful, a way to send more information to screen Reader (and screen readers only)."&lt;/p&gt;

&lt;p&gt;But don't stop at this thought for three reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Firstly, don't go over the top and try to explain the usage of standard HTML controls and standard ARIA widgets. Adrian Roselli has summed it up wonderfully in his article &lt;a href="https://adrianroselli.com/2019/10/stop-giving-control-hints-to-screen-readers.html"&gt;"Stop Giving Control Hints to Screen Readers"&lt;/a&gt; a few days ago.&lt;/li&gt;
&lt;li&gt;Secondly, you couldn't just apply &lt;code&gt;aria-label&lt;/code&gt; on anything. If you aim to add the attribute on static content (minus elements with landmark roles like &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;) be aware that you open pandora's box and can't rely on consistent screen reader behavior. To learn more,  read "&lt;a href="http://www.davidmacd.com/blog/does-aria-label-override-static-text.html"&gt;What happens with aria-labelledby, aria-label and aria-describedbyon static HTML elements?&lt;/a&gt;" by David MacDonald.&lt;/li&gt;
&lt;li&gt;Thirdly, if you are using &lt;code&gt;aria-label&lt;/code&gt; and a realtime translation service like Google Translate its values won't be translated in every browser (only in Google Chrome at the time of writing). To circumvent this issue, you could use text perceivable for everyone, and, if you want to influence the accessible name of a given element, you could point to it via &lt;code&gt;aria-labelledby&lt;/code&gt; .&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>a11y</category>
    </item>
    <item>
      <title>Using JavaScript framework powers for good </title>
      <dc:creator>Marcus Herrmann</dc:creator>
      <pubDate>Mon, 12 Aug 2019 07:26:17 +0000</pubDate>
      <link>https://dev.to/marcush/using-javascript-framework-powers-for-good-ncg</link>
      <guid>https://dev.to/marcush/using-javascript-framework-powers-for-good-ncg</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="https://marcus.io/blog/using-framework-powers-for-good"&gt;marcus.io&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Usually, when talking about modern JavaScript frameworks and accessibility, the dominant opinion is "React and company are bad for for the inclusive web". But in my opinion, it is not the frameworks that are to blame – you can write accessible or inaccessible code, just like you would (or wouldn't) in plain, old, toolchain- and component-less HTML. Rather, what leads to inaccessible apps in the end is education and framework ecosystems: First, boot camps and trainings that focus on features, instead of HTML/CSS fundamentals. Secondly, inaccessible code in tutorials and the overall lack of awareness (admittedly, this is also valid for the web platform as a whole).&lt;/p&gt;

&lt;p&gt;But this post is not about real or perceived problems of modern JavaScript frameworks – it's about using their strengths, their unique features or architectural approaches for the sake of accessibility. &lt;a href="https://twitter.com/_marcusherrmann/status/1159330247403298816"&gt;This week I asked on twitter&lt;/a&gt; about ideas of how to use frameworks for a good cause, so to speak: In what ways could React, Vue, Angular and Co and their features actually facilitate inclusive designs?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Let's turn the WebApp/React/A11y discussion around: Do you know of examples where framework characteristics, component based architectures, their abilities etc. actually help #a11y, or at least ease building thoughtful and inclusive applications?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  There &lt;em&gt;are&lt;/em&gt; advantages
&lt;/h2&gt;

&lt;p&gt;I got great replies to that. Here's my try of summarizing, clustering and interpreting the answers:&lt;/p&gt;

&lt;h3&gt;
  
  
  Developer experience
&lt;/h3&gt;

&lt;p&gt;Make accessible solutions part of the developer experience - that means: make things easy and fun to use. Use the architectural advantage that everything (including helpers or linters for accessibility norms) is just a &lt;code&gt;npm install&lt;/code&gt; away.&lt;/p&gt;

&lt;h3&gt;
  
  
  Externals: usable, internals: accessible
&lt;/h3&gt;

&lt;p&gt;With ideal components, all the accessibility features are taken care of, are battle-tested so to speak – but hidden away in their "engine room". The developer just uses the components interface, so to speak. &lt;a href="https://twitter.com/hdv/status/1159514406423859200"&gt;Or as Hidde de Vries puts it&lt;/a&gt;: Separating the components' internals from its usage layer (&lt;a href="https://hiddedevries.nl/en/blog/2019-05-24-baking-accessibility-into-components-how-frameworks-help"&gt;more in his corresponding blog post "Baking accessibility into components"&lt;/a&gt;)&lt;/p&gt;

&lt;h3&gt;
  
  
  Making accessibility hard to circumvent
&lt;/h3&gt;

&lt;p&gt;Make the usage not only a joy but ensure that it's actually an effort to make an implementation inaccessible (&lt;a href="https://twitter.com/dan_abramov/status/1159440403625598977"&gt;David Brunelle's statement via Dan Abranov&lt;/a&gt;). He links &lt;a href="https://www.starbucks.com/developer/pattern-library/components/forms/"&gt;Starbucks' React pattern library&lt;/a&gt; as an example.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/ptrin/status/1159439741437304834"&gt;Perry Trinier&lt;/a&gt; writes that the component-based architecture can help us enforcing accessibility features by setting up related required prop types (e.g. input labels, legend for a fieldset)&lt;/p&gt;

&lt;h4&gt;
  
  
  Use all of the framework's functionality...
&lt;/h4&gt;

&lt;p&gt;Your framework has features that aim to make your life as a developer easier, for example concepts like mixins in Vue or hooks in React. &lt;a href="https://twitter.com/marcysutton/status/1159336829084004352"&gt;Marcy Sutton&lt;/a&gt;, &lt;a href="https://twitter.com/JamesNimlos/status/1159487023347974145"&gt;James Nimlos&lt;/a&gt;, and &lt;a href="https://twitter.com/kryptos_rsa/status/1159367612792483841"&gt;Almero Steyn&lt;/a&gt; suggest to use these for managing ARIA states and property values, e.g. for example generated unique IDs for ARIA references (&lt;code&gt;aria-labelledby&lt;/code&gt;, &lt;code&gt;aria-describedby&lt;/code&gt;, &lt;code&gt;aria-controls&lt;/code&gt; et cetera), or explicit labels of your inputs (this concept: &lt;code&gt;&amp;lt;label for="foo"&amp;gt;Name:&amp;lt;/label&amp;gt;&amp;lt;input id="foo" /&amp;gt;&lt;/code&gt; – where "foo" would be the generated id).&lt;/p&gt;

&lt;h3&gt;
  
  
  ...and its design approach
&lt;/h3&gt;

&lt;p&gt;In his tweet, &lt;a href="https://twitter.com/giuseppegurgone/status/1159548580241268736"&gt;@giuseppegurgone mentioned&lt;/a&gt; that you could use a framework's declarative nature for you for accessibility features. Guiseppe also wrote a detailed blog post about what he means by this: &lt;a href="https://pspdfkit.com/blog/2018/building-accessible-modals-with-react/"&gt;"Building accessible modals with React"&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automate...
&lt;/h3&gt;

&lt;p&gt;Almero Steyn reminds us: We can let our framework and the fact that we are not only writing markup, but actually are programming help us with your document outline: &lt;a href="https://twitter.com/kryptos_rsa/status/1159465365233111040"&gt;For example by automating your headline levels with the Heading component of tenon UI&lt;/a&gt; (idea by &lt;a href="https://twitter.com/sophiebits"&gt;Sophie Albert&lt;/a&gt;)&lt;/p&gt;

&lt;h3&gt;
  
  
  ...or use props in a smart way
&lt;/h3&gt;

&lt;p&gt;If you don't want to go full automation, you can still use props to pass the appropriate heading level into you component, as Heydon Pickering wrote in last year's &lt;a href="https://medium.com/@Heydon/managing-heading-levels-in-design-systems-18be9a746fa3"&gt;"Managing heading levels in design systems"&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Both sides of the (app) story
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://twitter.com/accessabilly/status/1159538762155810817"&gt;@accessabilly&lt;/a&gt; likes that frameworks offer "the possibility to have (mostly) identical code on server and client at the same time. This offers opportunities for Progressive Enhancement."&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion (for now)
&lt;/h2&gt;

&lt;p&gt;Thanks again to all respondents! All in all these replies a very good starting points for deeper research and frankly speaking really inspiring stuff. And motivating – on the one hand, to dive in deeper into the framework's advanced concepts, but on the other hand, motivating to check all future features for suitability to improve accessibility. So that hopefully in the months and years to come this list of "framework-exclusive accessibility advantages" grows and grows!&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webapp</category>
      <category>react</category>
      <category>vue</category>
    </item>
    <item>
      <title>What are the accessibility challenges when building web apps?</title>
      <dc:creator>Marcus Herrmann</dc:creator>
      <pubDate>Wed, 20 Mar 2019 14:50:59 +0000</pubDate>
      <link>https://dev.to/marcush/what-are-the-accessibility-challenges-when-building-web-apps-2a6</link>
      <guid>https://dev.to/marcush/what-are-the-accessibility-challenges-when-building-web-apps-2a6</guid>
      <description>&lt;p&gt;A web application is a computer program that runs in your browser. It is hard to expand the general definition further. &lt;a href="https://en.wikipedia.org/wiki/Web_application"&gt;Wikipedia&lt;/a&gt; says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The general distinction between a dynamic web page of any kind and a "web application" is unclear. Web sites most likely to be referred to as "web applications" are those which have similar functionality to a desktop software application, or to a mobile app.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But regardless of whether it's a dynamic web page or a single page application - modern "app-like" functionality is built with JavaScript (sometimes with a framework) and this JavaScript should work (and be accessible) for everyone.&lt;/p&gt;

&lt;p&gt;Maybe you read in the past that JavaScript is bad for accessibility. While it's always good to build digital products with progressive enhancement in mind some web projects simply can not be made accessible &lt;strong&gt;&lt;em&gt;without&lt;/em&gt;&lt;/strong&gt; JavaScript.&lt;/p&gt;

&lt;p&gt;Now, what are the specific problems that come with JavaScript?&lt;/p&gt;

&lt;h3&gt;
  
  
  Click targets that are not links
&lt;/h3&gt;

&lt;p&gt;I'll admit that that headline is a simplification. Of course, even on "non-dynamic web pages" there a more click targets than links. Take a submit button or input elements in forms for example.&lt;/p&gt;

&lt;p&gt;The reality is, however, that many web pages offer click targets that are only that - &lt;strong&gt;click&lt;/strong&gt; targets. Neither can you reach them or interact with them via keyboard nor use them with assistive technologies such as screen reader or voice input software. And why? Because, often times the code looks something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"someClickHandler"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;To be or not to be a button&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;While you &lt;em&gt;can&lt;/em&gt; assign a click handler to any element that doesn't mean that you &lt;em&gt;should.&lt;/em&gt; What you should do is using the (maybe boring but powerful) &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; element, because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Buttons are recognized as interactive elements by all user agents - regardless of whether the web document is perceived visually, auditory or else. It's the Swiss army knife of interaction elements on the web, especially when you use &lt;code&gt;&amp;lt;button type="button" /&amp;gt;&lt;/code&gt; to clarify you don't want this button to submit any form by accident. If you wanted to "upgrade" your span to a button - but only regarding its perception, not its functionality - you would need to add &lt;code&gt;role="button"&lt;/code&gt; (among other things, read on).&lt;/li&gt;
&lt;li&gt;Buttons are by default focusable with the keyboard (if you wanted to make our "span button" focusable you would have to add &lt;code&gt;tabindex="0"&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Buttons can be activated by click or touch, but also by ENTER or SPACE keystrokes. So no need to register extra event listeners. Adding a listener on click is fine, ENTER or SPACE keystrokes will be relayed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Web developers love shortcuts and tools that save time - still some of them refrain from using the battery-included element for interactivity, although it could save precious time and lines of code.&lt;/p&gt;

&lt;h4&gt;
  
  
  But the styling
&lt;/h4&gt;

&lt;p&gt;Maybe the aversion to buttons has to do with their default styling. It differs from browser to browser and from operating system to operating system, and giving them a coherent styling used to be hard. But that is not the case anymore. Just apply:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;-webkit-appearance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;font&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;inherit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;inherit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  But I could use a link with href="#" to achieve the same thing
&lt;/h4&gt;

&lt;p&gt;In order to decide whether to use an &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; ask yourself: does interacting with that element navigate to a new place (including a change of URL), or does it change something on the page you are on (for example: opening a modal dialog, liking a status on a social media platform, adding an item into your online shopping cart).&lt;/p&gt;

&lt;p&gt;In case of navigation, use a link. In case of modification, use a button.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inputs and Controls
&lt;/h3&gt;

&lt;p&gt;A central part of a typical web app is usually to input data - you enter texts, upload files, make selections, check boxes, rearrange things and the like.&lt;/p&gt;

&lt;p&gt;Actually, building an inclusive web app means that anyone could do all these things mentioned above - regardless of what technology they use. Be it a visual browser and a mouse, a switch device, a braille reader that makes user perceive your app in a tactile way - or a screen reader that transforms it to an auditory experience.&lt;/p&gt;

&lt;p&gt;The creators of the web have built "input primitives" that cover many input cases - and you already know them. While making your app accessible, ask yourself - can I solve my case by using a text input, textarea, select or multi-select, or checkbox? If your answer is - yes, but they should not look "primitive" – be aware that styling them with CSS only has gotten easier and simpler over the last years. Visit sites like &lt;a href="http://wtfforms.com/"&gt;wtfforms.com&lt;/a&gt; to update your knowledge about what has become possible, if necessary.&lt;/p&gt;

&lt;p&gt;But even for the cases an "input primitive" does not suit your needs the web standard creators have you covered – with ARIA (which stands for: Accessible Rich Internet Applications). Regarding input and controls, Wikipedia describes it as follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;These user interface controls [...] are often not accessible to users with disabilities, especially screen reader users and users who cannot use a mouse or other pointing device. WAI-ARIA allows web pages (or portions of pages) to declare themselves as applications rather than as static documents, by adding role, property, and state information to dynamic web applications.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;WAI-ARIA has been around for a while and if you want to look into recommended approaches please check &lt;a href="https://www.w3.org/TR/wai-aria-practices-1.1/"&gt;ARIA Authoring Practices&lt;/a&gt;, or the skim through its &lt;a href="https://www.w3.org/WAI/ARIA/faq"&gt;FAQ&lt;/a&gt; (Frequently Asked Questions) to give yourself a general overview.&lt;/p&gt;

&lt;h3&gt;
  
  
  AJAX  - Changing and loading things asynchronously
&lt;/h3&gt;

&lt;p&gt;Web apps try to emulate native apps also regarding their reactivity after some user input. Where a "standard" website would load (anew) after an interaction happend (e.g. with a link or submit button) web apps use an approach dubbed AJAX some time ago. Meaning: asynchronously fetching or storing data without triggering a webpage reload.&lt;/p&gt;

&lt;p&gt;As a consequence a web app using AJAX feels "snappy", just like its paragon, the native app. Unfortunately this asynchronousity is rather bad for assistive technologies that consume a web document sequentially. Let's take a screen reader - its normal mode is to read the document from top to button (in reality no user uses it this way, but navigates via headline structure, landmarks, links, controls and the like). Given a screen reader user interacts with a button and, as a consequence, something happens in a web app said user has to actively search for what has changed on website.&lt;/p&gt;

&lt;h4&gt;
  
  
  An example
&lt;/h4&gt;

&lt;p&gt;Imagine an e-commerce site with "shopping cart" functionality - you browse to the site and can put products into your shopping basket. Let's say this process of "putting things into your cart" should feel &lt;em&gt;snappy&lt;/em&gt; and is built with AJAX - so that the user is not redirected to their cart every time they put a product in it. So the user finds a product and clicks on the big "Add to cart" button. Subsequently the shopping cart widgets gets updated, maybe increasing a counter badge somewhere - in short: visually abled users can see that their button click lead to the desired result.&lt;/p&gt;

&lt;p&gt;Our screen reader user just interacts with the "Add to cart" button - and then nothing obvious happens. Maybe it does, maybe a shopping cart widget somewhere else in the document is now populated - but maybe the interaction did fail. Unless the screen reader user actively searches for a possible change after button click they won't find out what happened. A very annoying and frustrating situation for them.&lt;/p&gt;

&lt;h4&gt;
  
  
  Solution strategies
&lt;/h4&gt;

&lt;p&gt;Luckily there are two strategies to avoid this annoyance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Moving focus programmatically after interaction. With a few exceptions focus shouldn't be explicitly moved but be predictable, so this has to be decided on a case to case basis. Often times the following option is better:&lt;/li&gt;
&lt;li&gt;Announcing the failure or success of the interaction with an ARIA live region. With live regions web developers can sprinkle a little asynchronousity into the screen reader experience - in the way that they can interrupt the reading in a polite or more assertive way. In our shopping cart example, a polite message that "Product A has been added to your shopping cart" could be the way. The screen readers virtual focus is not affected in any way – read: the user is still on the same spot in the document as before the interaction – but now they know that their button click actually did work. &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions"&gt;You can learn more about live regions in MDN's detailed documentation of this great functionality that enables users of assistive technologies to have a way better web app experience&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Route changes
&lt;/h3&gt;

&lt;p&gt;There is a very special type of web app: the Single Page Application (SPA). A SPA consists of one single HTML document (hence the name) - anything else is being loaded in an asynchronous way without ever really navigating off of the page. &lt;a href="https://en.wikipedia.org/wiki/Single-page_application"&gt;Quote Wikipedia&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;[A Single Page application] interacts with the user by dynamically rewriting the current page rather than loading entire new pages from a server. This approach avoids interruption of the user experience between successive pages, making the application behave more like a desktop application.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So SPAs are asynchronous beasts - therefore all the strategies regarding notifying user of client side changes apply - but there is one more peculiarity. Continue quote:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The page does not reload at any point in the process, nor does control transfer to another page, although the location hash or the HTML5 History API can be used to provide the perception and navigability of separate logical pages in the application.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So Single Page Applications emulate changes of locations by modifying the location hash - to that navigating a SPA feels like navigating a "static page", but quicker and without any server configuration. This is called "routing".&lt;/p&gt;

&lt;p&gt;And it is actually a topic for accessibility. Remember the e-commerce example from above -a user clicks on a button and is not provided with a response whether something happened after? The situation when it comes to routing is the same: a screen reader user interacts with a (routing) link - and nothing happens; although, in most cases, large parts of the page have changed.&lt;/p&gt;

&lt;h4&gt;
  
  
  Best practices for accessible routing:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;This is one of the rare occasions where moving focus is recommended. Since the topic of accessible routing is rather new and research for a solid best practice is still ongoing - as of now it's unclear where exactly the focus should be sent to:

&lt;ul&gt;
&lt;li&gt;To the top of the document? If implemented this user experience would come close to the experience of a "real page load"&lt;/li&gt;
&lt;li&gt;To the "routing container"? This would mean sending the focus to the element whose content has been exchanged.&lt;/li&gt;
&lt;li&gt;To the first sensible headline of the newly loaded content? What is in favor of this approach is that the user lands directly in the requested content&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;But regardless of the exact focus target - focus management after route transitions should have a certain delay to take loading times into consideration&lt;/li&gt;
&lt;li&gt;Also, it is best practice to change the document's title after a route change&lt;/li&gt;
&lt;li&gt;Last but not least: When focus management is just not enough to make the inner workings of your Single Page App transparent to your users (for example when external data needs to be fetched before it can be displayed, and focus moved), consider using a live area to inform users that their request was successful but your app needs a little bit more time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;All in all, the specifics of web apps can be summarized in two points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Be very clear and transparent about the input options of your app. Remember that the visual representation of a user input is not enough. For example: What looks like a button should be a button &lt;em&gt;semantically&lt;/em&gt; and not only a span with a click event listener. For edge cases, consult &lt;a href="https://www.w3.org/TR/wai-aria-practices-1.1/"&gt;ARIA Authoring Practice&lt;/a&gt; (and &lt;a href="https://accessible-app.com"&gt;accessible-app.com&lt;/a&gt;, of course).&lt;/li&gt;
&lt;li&gt;Be very clear and transparent about the output of your app, especially when it its not accompanied with a full page reload, and especially when the output happened after some user input. Consult &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions"&gt;WAI ARIA live region documentation&lt;/a&gt; for accessible announcements and visit &lt;a href="http://accessible-app.com"&gt;accessible-app.com&lt;/a&gt; once in a while to learn more about emerging best practices (and ready-made framework solutions) regarding accessible routing.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>a11y</category>
      <category>webapp</category>
    </item>
    <item>
      <title>Accessible animations with Vue</title>
      <dc:creator>Marcus Herrmann</dc:creator>
      <pubDate>Fri, 01 Mar 2019 16:53:05 +0000</pubDate>
      <link>https://dev.to/marcush/accessible-animations-with-vue-lm8</link>
      <guid>https://dev.to/marcush/accessible-animations-with-vue-lm8</guid>
      <description>&lt;p&gt;To make the user experience pleasant and - above all - more app-like web-app authors use not only the strategy of asynchronous loading data but also animation. While the user experience of your app could benefit from it (see: &lt;a href="https://www.everyinteraction.com/articles/functional-animation-helps-improve-user-experience/"&gt;"How Functional Animation Helps Improve User Experience"&lt;/a&gt;) sudden movements could cause, for example, dizziness, vertigo or nausea for some of your users suffering from a motion sensitivity such as &lt;a href="https://vestibular.org/understanding-vestibular-disorder"&gt;vestibular disorders&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Imagine a world where your internal gyroscope is not working properly. Very similar to being intoxicated, things seem to move of their own accord, your feet never quite seem to be stable underneath you, and your senses are moving faster or slower than the rest of syour body.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Source: A11y Project's &lt;a href="https://a11yproject.com/posts/understanding-vestibular-disorders/"&gt;A primer to vestibular disorders&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Luckily there is a new CSS media query (&lt;a href="https://caniuse.com/#search=prefers-reduced-motion"&gt;which gains traction regarding browser suppport&lt;/a&gt;): &lt;code&gt;prefers-reduced-motion&lt;/code&gt;. For example in Apple's MacOS and iOS user can enable this setting on an operating system level (&lt;em&gt;System Settings - Accessibility - Display&lt;/em&gt;) - which let CSS authors detect this user preference:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefers-reduced-motion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* Disable animation on your selectors here */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;But to create an accessible experience in your app even to users are using a OS that does not offer this setting, web app authors should use the pwoer of their material: managing state. You could establish a setting regarding animations in your app that mimics &lt;code&gt;prefers-reduced-motion&lt;/code&gt; and could be applied to our app's &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; element. So, if set to true, and therefore present on the body element the following selector would work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="nc"&gt;.user-prefers-reduced-motion-reduce&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* Disable animation on your selectors here */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I have implemented both described ways and means in &lt;a href="https://vuejs.accessible-app.com"&gt;https://vuejs.accessible-app.com&lt;/a&gt;. If you are on a Mac and want to it out, head to your OS's System Settings and set the "Reduce motion" checkbox. If you happen to use a system without a setting like this you can go to the settings page inside the app: Click the Account button, then go to "My settings". Over there you will find - not very much, actually - but a checkbox labelled "Disable animations". Code-wise checking it adds &lt;code&gt;.user-prefers-reduced-motion-reduce&lt;/code&gt; to the body.&lt;/p&gt;

&lt;p&gt;Now that we know about activation let's look into the way of actually disabling animations, and it's straight-forward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prefers-reduced-motion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;-webkit-animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.user-prefers-reduced-motion-reduce&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="err"&gt;*&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;-webkit-animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;My "Accessibook" example app uses animations rather lightly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once a modal window is opened&lt;/li&gt;
&lt;li&gt;Once you click on one of the menu buttons (Shopping Cart, Account)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But with either &lt;code&gt;.user-prefers-reduced-motion-reduce&lt;/code&gt; or &lt;code&gt;prefers-reduced-motion: reduce&lt;/code&gt; set you will see that these animations disappear. I admit, disabling these animations isn't the most compelling example - but hopefully I get the idea across. An idea that one as a web app author should take note of "user queries" like prefers-reduced-motion and that you should offer a choice regarding your animations - independently from this media query's dissemination.&lt;/p&gt;

&lt;p&gt;If you want to look into the exact code of the Vuejs implementation of Accessibooks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/accessible-app/vuejs/blob/master/src/scss/utils/_a11y.scss"&gt;Find the animation disabling CSS here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/accessible-app/vuejs/blob/master/src/store.js#L16"&gt;How I used Vue's state manager, vuex, for syncing the animation preference across the app's views&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/accessible-app/vuejs/blob/master/src/components/ShoppingCartMenu.vue#L4"&gt;How either prefers-reduced-motion of the user setting "even" disables Vue's &lt;code&gt;&amp;lt;transition /&amp;gt;&lt;/code&gt; component - because it uses CSS animations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/accessible-app/vuejs/blob/master/src/views/Settings.vue"&gt;...and how the settings page works&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vue</category>
      <category>a11y</category>
      <category>animation</category>
    </item>
    <item>
      <title>Using summary/details as a menu</title>
      <dc:creator>Marcus Herrmann</dc:creator>
      <pubDate>Thu, 28 Feb 2019 06:33:02 +0000</pubDate>
      <link>https://dev.to/marcush/using-summarydetails-as-a-menu-16ni</link>
      <guid>https://dev.to/marcush/using-summarydetails-as-a-menu-16ni</guid>
      <description>&lt;p&gt;My original intention for the next article of the &lt;a href="https://accessible-app.com"&gt;#accessibleapp project&lt;/a&gt; was to look at "notifying users of changes", especially regarding content reloads that do not trigger a full page reload (that lack of a full page reload in Single Page Apps leads to the necessity to come up with a routing strategy). Putting an item into a shopping cart in an e-commerce context without redirecting to a proper shopping cart page can be such an asynchronous change of content, and could be hard to notice for, e.g., screen reader users. &lt;a href="https://tink.uk/accessible-forms-with-aria-live-regions/"&gt;Leonie Watson writes about this problem&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The update is easy to see at a glance, but not at all easy with a screen reader. First you have to discover that something has changed, then you have to find out where it happened. Even once you know this, you still need to move focus back and forth between the summary and the product information, every time you add an item to the basket.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And at the same time she points to a solution strategy: Using &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions"&gt;aria-live regions&lt;/a&gt; to announce changes on the site or in the app that happened without proper page reload. So, I thought, the next thing to add to my accessible example app "&lt;a href="https://vuejs.accessible-app.com"&gt;Accessibooks&lt;/a&gt;" is shopping cart functionality - it's a fake shopping app after all. While building the feature it turned out that I touch on other accessibility topics, and each one of them is worth their own blog post:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Animations, and how to turn them off via setting within the app, or inside your operating system&lt;/li&gt;
&lt;li&gt;Aforementioned use of aria-live regions after shopping cart changes&lt;/li&gt;
&lt;li&gt;And how to markup the shopping cart as a menu widget in general&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The following part of this article will be about the latter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Details/Summary
&lt;/h3&gt;

&lt;p&gt;When you read &lt;a href="https://marcus.io/blog/a11y-app-menu-button"&gt;my last #accessibleapp article&lt;/a&gt; you will notice that I added an update regarding the &lt;a href="https://www.w3.org/TR/wai-aria-practices-1.1/#menu"&gt;WAI ARIA Authoring Practice I based my "vue-menu-button"&lt;/a&gt; on. &lt;a href="https://github.com/w3c/aria-practices/issues/353"&gt;The situation is not very clear, there are many experiences with and opinions on this subject&lt;/a&gt;. Until there is more user data available on this subject I decided to remove the menu/menu-item pattern from the account button and use a more simple solution instead: details and summary (&lt;a href="https://marcus.io/blog/progressive-enhanced-menus-details-summary"&gt;I wrote a small note on how GitHub is using these elements for their menu structure&lt;/a&gt; - &lt;a href="https://twitter.com/muanchiou/status/1093243419948912645"&gt;although relying on the menu/menuitem pattern&lt;/a&gt;). Especially regarding the fact that I - until now  - only added links to that specific menu.&lt;/p&gt;

&lt;p&gt;So, my next step was to implement &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;summary&amp;gt;&lt;/code&gt; in Vue. Which was very easy, due to the elements on-board toggling behavior. Here is the structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;details ref="details"&amp;gt;
    &amp;lt;summary&amp;gt;I'm the trigger&amp;lt;/summary&amp;gt;
    &amp;lt;div class="content"&amp;gt;
        Here goes the content that is initially hidden
        but visible once details has the open attribute
    &amp;lt;/div&amp;gt;
&amp;lt;/details&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;What happens on the HTML side of things is: once the summary element is activated (via click, touch, enter, space-bar) the &lt;code&gt;open&lt;/code&gt; attribute is added to the &lt;code&gt;details&lt;/code&gt; element as a whole. To achieve a "menu look" I only had to style the content that I intended to use as "menu content"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[open] .content {
  position: absolute;
  background-color: #ffffff;
  min-width: 320px;
  padding: 10px 0;
  border: 1px solid #2368a2;
  animation: slide-down 0.2s ease;
  box-shadow: 4px 4px 6px 0 #6665654d;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;summary&lt;/code&gt;, element, when unstyled, includes a caret. You can remove it via:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;summary {
  list-style: none;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;One last thing I added was a feature which I had built for the menu button: that a click outside my details/summary construct removes the open attribute and, therefore, closes the menu. This was the first "real" part where I had to deal with Vue and JavaScript, and it was as easy as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
export default {
  name: "NavigationMenu",
  created() {
    // On components creation, add click event listener to document
    document.addEventListener("click", this.documentClick);
  },
  methods: {
    documentClick(e) {
      // Get the details element
      let el = this.$refs.details;

      // Check if click happend inside component
      let target = e.target;

      // If not, close
      if (el !== target &amp;amp;&amp;amp; !el.contains(target)) {
         this.$refs.details.removeAttribute("open");
      }
    }
  }
};
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I will use this approach both for the account (which will contain links) and the shopping cart button. Thats why I made a component out of the structure, styling and "behavior" I described in this article.&lt;/p&gt;

&lt;p&gt;You can see the aforementioned buttons in action on &lt;a href="https://vuejs.accessible-app.com"&gt;https://vuejs.accessible-app.com&lt;/a&gt;. Actually, there is a lot more to see (and to hear). But as I wrote above - I will explain the other features of the shopping cart in separate articles.&lt;/p&gt;

&lt;p&gt;For now, let's wrap up. Once I find the time, it's likely that I release my light Vue wrapper for details/summary as a discrete component, that also deals with the &lt;a href="https://caniuse.com/#search=summary"&gt;browser support&lt;/a&gt; by adding a polyfill. But at this point in the example app's life using details/summary for these menu purposes feels right overall.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>vue</category>
      <category>summarydetails</category>
      <category>menu</category>
    </item>
    <item>
      <title>Progressively enhanced menu buttons with details/summary</title>
      <dc:creator>Marcus Herrmann</dc:creator>
      <pubDate>Fri, 01 Feb 2019 15:00:51 +0000</pubDate>
      <link>https://dev.to/marcush/progressively-enhanced-menu-buttons-with-detailssummary-20mp</link>
      <guid>https://dev.to/marcush/progressively-enhanced-menu-buttons-with-detailssummary-20mp</guid>
      <description>&lt;p&gt;While researching for the &lt;a href="https://marcus.io/blog/a11y-app-menu-button"&gt;accessible approach to menu buttons in Vue&lt;/a&gt; this week, I couldn't help myself but to open my browser's dev tools on every "menu button" sighting I came across, curious how the respective team or developer implemented it.&lt;/p&gt;

&lt;p&gt;The concept of a "menu" of any kind is often found in profile dropdows. Some websites decide to not use a semantic menu at all, "just" showing a div or list on click and releasing its content into the tab order, (&lt;a href="https://dev.to/"&gt;dev.to, for example)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And there is GitHub's approach that uses the details and summary element for a menu, making the whole construct work even without JavaScript (&lt;a href="https://caniuse.com/#search=details"&gt;in nearly every browser&lt;/a&gt;). Here's the birds-eye view of their approach:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;details&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;Click me&lt;span class="nt"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;details-menu&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"menu"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;&amp;lt;!-- a custom element --&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"menuitem"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Agnetha&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"menuitem"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Björn&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"menuitem"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Benny&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"menuitem"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Anni-Frid&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/details-menu&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;details&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I won't try to explain it any further - because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub put their approach on, well, GitHub: &lt;a href="https://github.com/github/details-menu-element"&gt;the &lt;code&gt;&amp;lt;details-menu&amp;gt;&lt;/code&gt; custom element&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Mu-An Chiou, Web Systems Engineer at GitHub, not only &lt;a href="https://docs.google.com/presentation/d/1hvnPpsJo44BTPfJx28CV95vqk_dt6na1awUbk0kmZYM/edit#slide=id.p"&gt;did a presentation about their technique (link to slides)&lt;/a&gt;, but supplied a &lt;a href="https://github.com/muan/details-on-details"&gt;&lt;em&gt;details on details&lt;/em&gt; document&lt;/a&gt; with further links and anecdotes&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/muanchiou/status/1091331877636661249"&gt;Mu-An is approachable on Twitter, offering to chat about her approach&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>a11y</category>
      <category>javascript</category>
      <category>pe</category>
    </item>
    <item>
      <title>Accessible menu buttons in vue.js</title>
      <dc:creator>Marcus Herrmann</dc:creator>
      <pubDate>Wed, 30 Jan 2019 19:33:36 +0000</pubDate>
      <link>https://dev.to/marcush/accessible-menu-buttons-in-vuejs-4760</link>
      <guid>https://dev.to/marcush/accessible-menu-buttons-in-vuejs-4760</guid>
      <description>&lt;p&gt;tldr; &lt;a href="https://github.com/marcus-herrmann/vue-menu-button"&gt;https://github.com/marcus-herrmann/vue-menu-button&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My approach is to first map common widgets and scenarios in Single Page Apps to &lt;a href="https://accessible-app.com"&gt;accessible-app.com&lt;/a&gt; (for this reason modal dialogs and routing are already part of &lt;a href="https://vuejs.accessible-app.com"&gt;the demo application&lt;/a&gt;). What you also see very often are menu buttons. &lt;a href="https://inclusive-components.design/menus-menu-buttons"&gt;Now Heydon's right about this&lt;/a&gt; - when talking about menu buttons, the terminology soon becomes blurred. There are some "menus" or "dropdowns" out there that will show navigation items on click or hover (sometimes the triggering entity is a navigation item itself) - and there is the &lt;a href="https://www.w3.org/TR/wai-aria-practices/#menubutton"&gt;Menu Button Design pattern"&lt;/a&gt; from WAI-ARIA Authoring Practices 1.1. The latter definition of the term is discussed below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3.org/TR/wai-aria-practices/#menubutton"&gt;ARIA Menu Button chapter&lt;/a&gt; lists two examples of what they mean by that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigation menu buttons&lt;/li&gt;
&lt;li&gt;Action menu buttons&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Differences
&lt;/h2&gt;

&lt;p&gt;The difference between these two approaches lies in the content of the menu. Navigation menus contain links:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The menu items are made from HTML links and maintain their HTML link behaviors. That is, activating a menuitem loads the link target, and the browser's link context menu and associated actions are available.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While Action menus contain actions (duh). To my understanding, these menu actions have things in common with buttons (e.g. they don't change the URL), but lack many of their advantages (e.g. listening on "Enter" and "Space" key events, automatically being part of the tab-order).&lt;/p&gt;

&lt;h2&gt;
  
  
  Similarities
&lt;/h2&gt;

&lt;p&gt;In standard navigation menus we often see the use of role="menu" and role="menu-item". &lt;a href="http://adrianroselli.com/2017/10/dont-use-aria-menu-roles-for-site-nav.html"&gt;In this context, these uses are wrong&lt;/a&gt;, in Menu Buttons however correct (again, see &lt;a href="https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-links.html"&gt;the ARIA practice&lt;/a&gt;). This leads to a general structure that both Navigation menu buttons and Action menu buttons share:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight xml"&gt;&lt;code&gt;button
 menu
     menu-item
     menu-item
     menu-item
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now we have to convey relationships between this items. ARIA requires for menu button to have&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;aria-haspopup="true"&lt;/code&gt; to indicate the button opens a menu&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;aria-controls="IDREF"&lt;/code&gt; to refer to the element controlled, in our case, the menu&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;aria-expanded="true"&lt;/code&gt; when the menu is open (&lt;code&gt;aria-expanded="false"&lt;/code&gt; or the removal of the attribute altogether communicate that the menu is closed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This gives us the following HTML for the button and the menu wrapper:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;aria-haspopup=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;aria-controls=&lt;/span&gt;&lt;span class="s"&gt;"the-menu"&lt;/span&gt; &lt;span class="na"&gt;aria-expanded=&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    Open me
&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;ul&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"the-menu"&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"menu"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    (menu-item)
    (menu-item)
    (menu-item)
&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I left out the markup for the menu-items deliberately, because it has to do with the decision where we want to build a Navigation menu button or Action menu button.&lt;/p&gt;

&lt;p&gt;For Navigation menu button items it is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"none"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"menu-item"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About Page&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Whereas for Action menu items:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"menu-item"&lt;/span&gt; &lt;span class="na"&gt;tabindex=&lt;/span&gt;&lt;span class="s"&gt;"-1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Print this page&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;At first glance, this is odd. But when you look closer, you'll see why it all makes sense:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The list with the id "the-list" is semantically speaking no list anymore because it has got &lt;code&gt;role="menu"&lt;/code&gt;. So, henceforth, it is a menu&lt;/li&gt;
&lt;li&gt;A menu expects to have menu-items as its children. Therefore we strip the &lt;code&gt;li&lt;/code&gt; of its semantic meaning as listitem:

&lt;ul&gt;
&lt;li&gt;When it is a Navigation menu-item, we set the &lt;code&gt;li&lt;/code&gt;'s role to none, but give the anchor element inside it the role of &lt;code&gt;menu-item&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;When it is an Action menu-item, the &lt;code&gt;li&lt;/code&gt; becomes a menu item. Also with the tabindex attribute we make sure we can set focus the item programmatically (more on that below).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keyboard accessibility
&lt;/h2&gt;

&lt;p&gt;Now that we established a menu - we essentially promised that the user can use it like one. And by "using" I mean that our menu reacts to the following keystrokes&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
ESC/Enter: closing the menu, setting focus to menu button&lt;/li&gt;
&lt;li&gt;
Up Arrow: Moves focus to the previous menu item, or: If focus is on the first menu item, moves focus to the last menu item.&lt;/li&gt;
&lt;li&gt;
Down Arrow: Moves focus to the next menu item, or: If focus is on the last menu item, moves focus to the first menu item.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ReachUI's approach
&lt;/h2&gt;

&lt;p&gt;Having read and studied the ARIA Authoring Practices I searched form menu button implementations in React and Vue. I found many pretty components with fancy animations and all, but all of them lacking both the menu button semantics and keyboard behaviours. Let's just assume that these scripts don't want to be menu buttons at all.&lt;/p&gt;

&lt;p&gt;Luckily there's React's ReachUI and its creator Ryan Florence &lt;em&gt;wants&lt;/em&gt; to supply a proper menu button component &lt;a href="https://ui.reach.tech/menu-button"&gt;(find the "MenuButton (Dropdown)" component here)&lt;/a&gt;. When I looked in its code examples I found something very interesting - a mix between Navigation and Action menu button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;Menu&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;MenuButton&amp;gt;&lt;/span&gt;
    Actions &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;aria-hidden&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;▾&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/MenuButton&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;MenuList&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;MenuItem&lt;/span&gt; &lt;span class="na"&gt;onSelect=&lt;/span&gt;&lt;span class="s"&gt;{()&lt;/span&gt; &lt;span class="err"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; alert("Download")}&amp;gt;Download&lt;span class="nt"&gt;&amp;lt;/MenuItem&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;MenuItem&lt;/span&gt; &lt;span class="na"&gt;onSelect=&lt;/span&gt;&lt;span class="s"&gt;{()&lt;/span&gt; &lt;span class="err"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; alert("Copy")}&amp;gt;Create a Copy&lt;span class="nt"&gt;&amp;lt;/MenuItem&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;MenuItem&lt;/span&gt; &lt;span class="na"&gt;onSelect=&lt;/span&gt;&lt;span class="s"&gt;{()&lt;/span&gt; &lt;span class="err"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; alert("Mark as Draft")}&amp;gt;Mark as Draft&lt;span class="nt"&gt;&amp;lt;/MenuItem&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;MenuItem&lt;/span&gt; &lt;span class="na"&gt;onSelect=&lt;/span&gt;&lt;span class="s"&gt;{()&lt;/span&gt; &lt;span class="err"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; alert("Delete")}&amp;gt;Delete&lt;span class="nt"&gt;&amp;lt;/MenuItem&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;MenuLink&lt;/span&gt;
      &lt;span class="na"&gt;component=&lt;/span&gt;&lt;span class="s"&gt;"a"&lt;/span&gt;
      &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://reach.tech/workshops"&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Attend a Workshop&lt;span class="nt"&gt;&amp;lt;/MenuLink&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/MenuList&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/Menu&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  My vue-menu-button
&lt;/h2&gt;

&lt;p&gt;This is an interesting approach I decided to emulate for Vue and especially for #accessibleapp. As of now, you can see the said button in use on &lt;a href="https://vuejs.accessible-app.com/"&gt;vuejs.accessible-app.com&lt;/a&gt; ("Account") and find the &lt;a href="https://github.com/marcus-herrmann/vue-menu-button"&gt;code for vue-menu-button on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Things I borrowed from ReachUI's component&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When your focus is on the button element and you hit either Up Arrow or Down Arrow the menu opens and movies focus to the first or last menu item respectively.&lt;/li&gt;
&lt;li&gt;The API of the component: If you want an action item, you can use &lt;code&gt;&amp;lt;MenuItem /&amp;gt;&lt;/code&gt; in Reach or &lt;code&gt;&amp;lt;menu-item /&amp;gt;&lt;/code&gt; my Vue component. If you want to place a link (or Navigation list-item) you can write &lt;code&gt;&amp;lt;MenuLink component="a" href="https://reach.tech/" ... &amp;gt;&lt;/code&gt; in Reach and you can use a &lt;code&gt;&amp;lt;menu-link /&amp;gt;&lt;/code&gt; component in my script. Bonus: you can place a &lt;code&gt;&amp;lt;router-link&amp;gt;&lt;/code&gt; in there, and it still works!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So here's the template of Accessible App's AccountButton component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;menu-wrapper&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;slot=&lt;/span&gt;&lt;span class="s"&gt;"menu-button"&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Account
    &lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;slot=&lt;/span&gt;&lt;span class="s"&gt;"menu-content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;menu-link&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class="na"&gt;to=&lt;/span&gt;&lt;span class="s"&gt;"/orders"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Past Orders&lt;span class="nt"&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/menu-link&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;menu-link&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class="na"&gt;to=&lt;/span&gt;&lt;span class="s"&gt;"/settings"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;My Settings&lt;span class="nt"&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/menu-link&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;menu-item&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"doSomething"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Clear my Shopping cart&lt;span class="nt"&gt;&amp;lt;/menu-item&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/menu-wrapper&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I'm somehow aware that my script could be improved regarding its options and configuration (if you have suggestions - please contribute!).  But what I wanted to do first is to show a way of how to write such a component in a semantic way, to listen to key events, to offer a reasonably API, &lt;a href="https://github.com/marcus-herrmann/vue-menu-button/blob/master/src/components/MenuWrapper.vue#L42"&gt;and for example, how to solve the &lt;code&gt;aria-controls&lt;/code&gt; reference&lt;/a&gt;. I hope I succeeded. But even if I didn't, I immersed myself intensively in the Menu Button design pattern during my research - and that alone was worth the effort.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>vue</category>
      <category>javascript</category>
      <category>spa</category>
    </item>
    <item>
      <title>Accessible routing with vue.js</title>
      <dc:creator>Marcus Herrmann</dc:creator>
      <pubDate>Fri, 11 Jan 2019 19:27:58 +0000</pubDate>
      <link>https://dev.to/marcush/accessible-routing-with-vuejs-ea</link>
      <guid>https://dev.to/marcush/accessible-routing-with-vuejs-ea</guid>
      <description>&lt;p&gt;Routing is an integral part of a Single Page Application, and therefore for my side-project &lt;a href="http://accessible-app.com"&gt;accessible-app.com&lt;/a&gt;. Since it's so central for Single Page App inclusiveness it is the first of the committed features for version 1 of Accessible App I decided to tackle. Also, from all of the big JavaScript frameworks I want to cover in this project, I am most familiar with Vue. So I tried to use the official Router, &lt;a href="https://router.vuejs.org/"&gt;vue-router&lt;/a&gt;, in an accessible way.&lt;/p&gt;

&lt;p&gt;As I mentioned before, React is ahead of Vue when it comes to plug-and-play solutions for and documenting of accessible solutions in their framework. One of the (aiming to be) ready-made solutions is &lt;a href="http://reach.tech/"&gt;Reach UI&lt;/a&gt;, specifically &lt;a href="https://reach.tech/router"&gt;Reach Router&lt;/a&gt; by &lt;a href="https://twitter.com/ryanflorence/"&gt;Ryan Florence&lt;/a&gt;. On &lt;a href="https://reach.tech/router/accessibility"&gt;Reach Router's product page&lt;/a&gt; he summarizes why developers must be aware of the accessibility problems that come with not refreshing the page as a whole:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Whenever the content of a page changes in response to a user interaction, the focus should be moved to that content; otherwise, users on assistive devices have to search around the page to find what changed – yuck! Without the help of a router, managing focus on route transitions requires a lot effort and knowledge on your part.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you use Reach Router in your React app it takes care of the managing focus part by manually setting the focus to the container of the newly loaded contents. This is great, but for my Vue routing approach, I wanted to make it configurable where focus is being sent to. You should be able to send the focus for example to a headline within the loaded content (as &lt;a href="https://dev.to/robdodson/managing-focus-64l"&gt;Google's Rob Dodson summarizes it concisely&lt;/a&gt;, or &lt;a href="https://simplyaccessible.com/article/spangular-accessibility/#acc-heading-3"&gt;simplyaccessible.com explains this in detail using Angular&lt;/a&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  Accessing the focus target
&lt;/h3&gt;

&lt;p&gt;We can mark the node where we will send the focus onto after route transition with a reference. Meaning: putting the &lt;code&gt;ref&lt;/code&gt; attribute on it and then accessing it (&lt;a href="https://codingexplained.com/coding/front-end/vue-js/accessing-dom-refs"&gt;learn more about accessing the DOM with $refs here&lt;/a&gt;). An example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;focusTarget&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Focus&lt;/span&gt; &lt;span class="nx"&gt;me&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="c1"&gt;// Get the element in Vue with this.$refs.focusTarget&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now that we got the reference to the focus target we must find out when a route transition happened, and hook into that event. You can use a watcher for this. But you have to make sure that you wait for the DOM to have actually changed. This is what &lt;a href="https://vuejs.org/v2/api/#Vue-nextTick"&gt;Vue.nextTick&lt;/a&gt; is for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;watch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;$route&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$nextTick&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// $nextTick = DOM updated&lt;/span&gt;

            &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;$mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Wait for it...
&lt;/h3&gt;

&lt;p&gt;One other thing is to add a delay before running the actual focus code. &lt;a href="http://dylanb.github.io/bower_components/a11yfy/examples/focus.html"&gt;This apparently stems from Voice Over failing to set focus on changed DOM nodes in iOS 7 and earlier&lt;/a&gt;. Although this appears to be fixed in Version 8 - since I can find new information on the topic, I'll add a delay.&lt;/p&gt;

&lt;p&gt;Now for the central focus part. At first, we're looking for the focusTarget ref. If your route watcher can't find it, our focus target will be the container where content will be loaded into after route transition. Vue Router calls it &lt;code&gt;&amp;lt;router-view&amp;gt;&lt;/code&gt;. To make this fallback easier to grab, we will add a reference to the router view like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Here be &amp;lt;router-links /&amp;gt;'s --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;router-view&lt;/span&gt; &lt;span class="na"&gt;ref=&lt;/span&gt;&lt;span class="s"&gt;"routerView"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/router-view&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;But back to JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Get component's "routeFocusTarget" ref.&lt;/span&gt;
&lt;span class="c1"&gt;// If not existent, use router view container itself&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;focusTarget&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$refs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;routerView&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$refs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;componentFocusTarget&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$refs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;routerView&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$refs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;componentFocusTarget&lt;/span&gt;
        &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$refs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;routerView&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$el&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Before we finally can set focus on the focus target we actually have to make sure that we can set focus programmatically to it (because usually, just interactive elements like buttons, links, or form inputs are focusable).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;focusTarget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tabindex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;-1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;GDS, the team behind &lt;a href="https://gov.uk"&gt;gov.uk&lt;/a&gt; has discovered that a "stray" tabindex on a wrapping container - &lt;a href="https://github.com/alphagov/govuk_elements/pull/534"&gt;in their case, the &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; element&lt;/a&gt;, which was a hack around &lt;a href="https://bugs.chromium.org/p/chromium/issues/detail?id=37721"&gt;a browser bug&lt;/a&gt; anyway, could cause some issues. Therefore, we're removing the tabindex just after eventually setting focus:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Focus element&lt;/span&gt;
&lt;span class="nx"&gt;focusTarget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;focus&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Remove tabindex from focustarget.&lt;/span&gt;
&lt;span class="nx"&gt;focusTarget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;removeAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tabindex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Putting it all together
&lt;/h3&gt;

&lt;p&gt;I've prepared a CodePen demonstrating this where I put all of the parts mentioned above together. In this example, the "route target" components are very simple - two of them have their componentFocusTarget explicitly set to their first headline, one of them to their general container DOM node, and one of them has no such ref at all. But in any case - focus is being dealt with after a route change. For debug and display purposes I made the focus visible with a red border. But moving focus on route change alone is not enough to achieve accessible routing. Once you change the URL in your Single Page App, &lt;strong&gt;you have to adjust the document's title as well&lt;/strong&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  Demo
&lt;/h3&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/marcus/embed/WYEypM?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;

&lt;p&gt;This way we prevent the situation described by Ryan Florence above - that a user of assistive technologies interacts with a route link, focus stays on said link, although parts of the DOM has changed, and they need to actively search for the changes.&lt;/p&gt;


&lt;h3&gt;Native focus management in vue-router&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/vuejs/vue-router/issues/2488"&gt;I filed a feature request on the focus subject in the official vue-router repo.&lt;/a&gt; Vue core member Eduardo San Martin Morote replied:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Thanks for bringing up the discussion. I've been looking at reach router for some time regarding this and it's something we should be able to provide&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not having to add strategies like the one mentioned above, and instead find this already built-in into vue-router would indeed be awesome!&lt;/p&gt;

&lt;p&gt;In the end, I am very curious what you think of this solution. Even to step back a bit - the focus management pattern for SPA routes presented here is a best practice, but all assumptions surrounding it should be tested (&lt;a href="https://twitter.com/marcysutton/status/1047892352747036672"&gt;and it would be great if Deque Systems, Marcy Sutton, and the accessibility community could conduct such a test&lt;/a&gt;). Until then, please don't hesitate to tell me what you think of this routing and focus management approach - and where it can be improved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update: Putting this technique into an example app
&lt;/h2&gt;

&lt;p&gt;I researched this routing strategy for #accessibleapp, a side-project where I collect techniques for building inclusive JavaScript web apps (in React, Vue and Angular). To supply a tangible example I built an example app called "Accessibooks", and you can find the Vue implementation at &lt;a href="https://vuejs.accessible-app.com"&gt;https://vuejs.accessible-app.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>vue</category>
      <category>javascript</category>
      <category>spa</category>
    </item>
  </channel>
</rss>
