<?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>Forem: ⚡️Ren⚡️</title>
    <description>The latest articles on Forem by ⚡️Ren⚡️ (@stories_of_ren).</description>
    <link>https://forem.com/stories_of_ren</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%2F319327%2Ff099ee96-c195-4b24-befb-f6c84f8da62a.jpg</url>
      <title>Forem: ⚡️Ren⚡️</title>
      <link>https://forem.com/stories_of_ren</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/stories_of_ren"/>
    <language>en</language>
    <item>
      <title>3 Ways to Start Incorporating Accessibility</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Thu, 02 Feb 2023 00:42:17 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/3-ways-to-start-incorporating-accessibility-p4</link>
      <guid>https://forem.com/stories_of_ren/3-ways-to-start-incorporating-accessibility-p4</guid>
      <description>&lt;p&gt;Traditionally, many think accessibility only benefits those with disabilities and helps people using mobile devices or those who experience slow network connections. In other words, by incorporating accessibility, you are expanding your user base and potential customers. The equity and equality of a website also become apparent; just like it is wrong to bar access to building for folks with disabilities, it would also be wrong to block access to your website. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;A note before we continue, assistive technology will mostly be referred to by AT throughout this post.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1) Add Text Alternatives &amp;amp; programmatically determined names
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Text alternatives&lt;/strong&gt; or &lt;strong&gt;alternative text&lt;/strong&gt; are text-based substitutes for non-text content on the web. Non-text content can include images, multimedia, data visualizations, and other visual or auditory presentation of information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Programmatically determined names&lt;/strong&gt; are the accessible names available to the browser and accessible technologies. Browsers use an algorithm called the &lt;a href="https://www.w3.org/TR/accname-1.1/" rel="noopener noreferrer"&gt;Accessible Name and Description Computation&lt;/a&gt; to determine these names. It's the information used by assistive technologies(&lt;strong&gt;AT&lt;/strong&gt;) to identify the HTML element.

&lt;ul&gt;
&lt;li&gt;The accessible name for an element can be derived from the element's content, an attribute, or an associated element.&lt;/li&gt;
&lt;li&gt;ie. When a Screen Reader reads through the DOM and comes to an interactive element, it will announce the element and its name.&lt;/li&gt;
&lt;li&gt;i.e., Using speech recognition, a user can target an element by the accessible name.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Benefits
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Adding text alternatives to non-text content serves several functions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AT&lt;/strong&gt; will present the text-based substitution to its user, helping those with visual or certain cognitive disabilities be able to perceive the content and function of the non-text content.&lt;/li&gt;
&lt;li&gt;If an image file becomes corrupt, broken, fails to load, or the user has blocked images from loading, the browser will provide the user with the text alternative.&lt;/li&gt;
&lt;li&gt;Good Text alternatives provide good SEO, and search engines will use text alternatives' content in their page assessment and rating.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Applying descriptive and concise accessible names provides access:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Providing role, state, and value information on all user interface components enables compatibility with &lt;strong&gt;AT&lt;/strong&gt;, such as screen readers, screen magnifiers, and speech recognition software used by people with disabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Text Alternative and Accessible Names in action
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Different ways to apply text alternatives&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ARIA&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;aria-describedby&lt;/code&gt; &lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby" rel="noopener noreferrer"&gt;MDN reference&lt;/a&gt;&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;This attribute lists the ids of the elements that describe the object.&lt;/li&gt;
&lt;li&gt;Can be used with images, form controls, widgets, groups of elements, regions with headings, definitions, and more&lt;/li&gt;
&lt;li&gt;When AT reads associated &lt;code&gt;aria-describedby&lt;/code&gt; text, all semantics are removed
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"EllenTerry-ladymacbeth.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Lady Macbeth"&lt;/span&gt; &lt;span class="na"&gt;aria-describedby=&lt;/span&gt;&lt;span class="s"&gt;"heading p1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h2&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"heading"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Ellen Terry as Lady Macbeth&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;id= &lt;/span&gt;&lt;span class="s"&gt;"p1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Lady Macbeth, standing, draped in a blue and green dress, raising a crown above her head. This painting dates back to 1889 and is oil on canvas. John Singer Sargent is the painter of the portrait of famous actress Dame Ellen Terry in her role of Lady Macbeth&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;For your inspection:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.tate.org.uk%2Fart%2Fimages%2Fwork%2FN%2FN02%2FN02053_10.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.tate.org.uk%2Fart%2Fimages%2Fwork%2FN%2FN02%2FN02053_10.jpg" alt="Lady MacBeth" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2 id="heading"&gt;Ellen Terry as Lady Macbeth&lt;/h2&gt;
&lt;br&gt;
 &lt;p id="p1"&gt;Lady Macbeth, standing, draped in a blue and green dress, raising a crown above her head. This painting dates back to 1889 and is oil on canvas. John Singer Sargent is the painter of the portrait of famous actress Dame Ellen Terry in her role of Lady Macbeth&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;HTML/ Inherent Attributes and Elements&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;alt="descriptive text here"&lt;/code&gt; &lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-alt" rel="noopener noreferrer"&gt;MDN reference&lt;/a&gt;&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;Defines an alternative text description of the image.&lt;/li&gt;
&lt;li&gt;Setting the &lt;code&gt;alt&lt;/code&gt; attribute to an empty string indicates that this image is a decorative element and is not essential to the content.

&lt;ul&gt;
&lt;li&gt;You can also set an image to be decorative if there is enough information from the contextual text to provide the description.&lt;/li&gt;
&lt;li&gt;i.e. a profile picture followed immediately by the name of the person &lt;em&gt;(this example is not always applicable in social media use cases.)&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;SVG: &lt;code&gt;&amp;lt;title /&amp;gt;&lt;/code&gt; &lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title" rel="noopener noreferrer"&gt;MDN reference&lt;/a&gt;&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;The SVG accessible name element&lt;/li&gt;
&lt;li&gt;Provides an accessible, short-text description of any SVG container element or graphics element
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="c"&gt;&amp;lt;!-- Using the alt text to describe the information present in the image --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src= &lt;/span&gt;&lt;span class="s"&gt;"EllenTerry-ladymacbeth.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt= &lt;/span&gt;&lt;span class="s"&gt;"Lady Macbeth standing, draped in a blue and green dress raising a crown above her head"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

    &lt;span class="c"&gt;&amp;lt;!-- Decorative Images --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"decorativeBG.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;For your inspection:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.tate.org.uk%2Fart%2Fimages%2Fwork%2FN%2FN02%2FN02053_10.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.tate.org.uk%2Fart%2Fimages%2Fwork%2FN%2FN02%2FN02053_10.jpg" alt="Lady Macbeth" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsteamuserimages-a.akamaihd.net%2Fugc%2F949590558702165309%2FB700E129E73B8BD33AF045A37BD6928582EACB44%2F%3Fimw%3D637%26imh%3D358%26ima%3Dfit%26impolicy%3DLetterbox%26imcolor%3D%2523000000%26letterbox%3Dtrue" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsteamuserimages-a.akamaihd.net%2Fugc%2F949590558702165309%2FB700E129E73B8BD33AF045A37BD6928582EACB44%2F%3Fimw%3D637%26imh%3D358%26ima%3Dfit%26impolicy%3DLetterbox%26imcolor%3D%2523000000%26letterbox%3Dtrue" alt="" width="637" height="358"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Different ways to apply accessible names&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ARIA&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;aria-labelledby&lt;/code&gt; &lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby" rel="noopener noreferrer"&gt;MDN reference&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enables developers to reference other elements on the page to define an accessible name&lt;/li&gt;
&lt;li&gt;With &lt;code&gt;aria-labelledby&lt;/code&gt; an element or elements that label the control are applied to it&lt;/li&gt;
&lt;li&gt;When AT reads associated &lt;code&gt;aria-labelledby&lt;/code&gt; text, semantics are removed&lt;/li&gt;
&lt;li&gt;ARIA labels override the content and accessible names for HTML elements&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;code&gt;aria-label="descriptive text here"&lt;/code&gt; &lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label" rel="noopener noreferrer"&gt;MDN reference&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Defines a string value that labels an interactive element&lt;/li&gt;
&lt;li&gt;When the default accessible name is missing or does not accurately describe the content/functionality, and &lt;code&gt;aria-labelledby&lt;/code&gt; isn't used to reference other content that could give it meaning, apply &lt;code&gt;aria-label&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;ARIA labels override the default text and accessible names for HTML elements
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!--aria-labelledby--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"checkbox"&lt;/span&gt;  &lt;span class="na"&gt;aria-labelledby=&lt;/span&gt;&lt;span class="s"&gt;"TermsConditions"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"TermsAndConditions"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;I agree to the Terms and Conditions.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!--aria-label--&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;aria-label=&lt;/span&gt;&lt;span class="s"&gt;"Close Dialogue"&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"close()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"close.svg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Associating the &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt; element explicitly &lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label" rel="noopener noreferrer"&gt;MDN reference&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Best practice for accessible form elements is to use the label element to associate text with form elements explicitly.&lt;/li&gt;
&lt;li&gt;Utilizing the &lt;code&gt;for&lt;/code&gt; attribute that takes in a single &lt;code&gt;id&lt;/code&gt; for the form-related element

&lt;ul&gt;
&lt;li&gt;When using libraries like React, you'll use &lt;code&gt;htmlFor&lt;/code&gt; to programmatically set the &lt;code&gt;for&lt;/code&gt; attribute &lt;span&gt;&lt;a href="https://reactjs.org/docs/dom-elements.html#htmlfor" rel="noopener noreferrer"&gt;&lt;em&gt;React Ref&lt;/em&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;label&lt;/span&gt; &lt;span class="na"&gt;for=&lt;/span&gt;&lt;span class="s"&gt;"firstname"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;First name:&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"firstname"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"firstname"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Associating the &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt; element implicitly &lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label" rel="noopener noreferrer"&gt;MDN reference&lt;/a&gt;&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;In some cases, form controls cannot be labeled explicitly

&lt;ul&gt;
&lt;li&gt;i.e. a form field is generated by a script, there may and/or may not be an id, and the developer may not have knowledge of the id and its contents&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;To implicitly label a form control, you use the &lt;code&gt;&amp;lt;label/&amp;gt;&lt;/code&gt; as a wrapper
&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;
      First name:
      &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"firstname"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Labeling buttons &lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button" rel="noopener noreferrer"&gt;MDN reference&lt;/a&gt;&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;The label and name for a &lt;code&gt;button&lt;/code&gt; are set inside the element.

&lt;ul&gt;
&lt;li&gt;Button content/labeling can include markup&lt;/li&gt;
&lt;li&gt;If creating a button using the &lt;code&gt;&amp;lt;input/&amp;gt;&lt;/code&gt; tag, the label is set with the value attribute
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-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;type=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Submit&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&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="nt"&gt;&amp;gt;&lt;/span&gt;Cancel&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Submit"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;input&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;value=&lt;/span&gt;&lt;span class="s"&gt;"Cancel"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Learning Resources
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Alt Text
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;WCAG References&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/text-alternatives" rel="noopener noreferrer"&gt;WCAG: Understanding SC 1.1 Text Alternatives Guideline&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/non-text-content" rel="noopener noreferrer"&gt;WCAG SC1.1.1 Non-text Content (Level A)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;a href="https://webaim.org/techniques/alttext/" rel="noopener noreferrer"&gt;WebAIM - techniques - alt text&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="https://www.w3.org/WAI/tutorials/images/" rel="noopener noreferrer"&gt;W3C Image Tutorials&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Accessible Names
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;WCAG References&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html" rel="noopener noreferrer"&gt;WCAG SC 4.1.2: Name, Role, Value (Level A)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/content-structure-separation-programmatic.html" rel="noopener noreferrer"&gt;WCAG SC 1.3.1: Info and Relationships (Level A)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;a href="https://webaim.org/articles/label-name/" rel="noopener noreferrer"&gt;WebAIM - Decoding Label and Name for Accessibility&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="https://www.w3.org/WAI/tutorials/forms/labels/#associating-labels-implicitly" rel="noopener noreferrer"&gt;W3C Labeling Controls&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href="https://webaim.org/techniques/hypertext/" rel="noopener noreferrer"&gt;WebAIM - Links and Hypertext&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  2) Use Semantic HTML
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What does it mean to write Semantic HTML?
&lt;/h3&gt;

&lt;p&gt;Using Semantic HTML5  to write the markup of the document content provides meaning and structure. This meaningful structure makes it easier for the browser and &lt;strong&gt;AT&lt;/strong&gt; to digest the content and make it perceivable to the users.&lt;/p&gt;

&lt;h3&gt;
  
  
  A few Basics on Semantic HTML
&lt;/h3&gt;

&lt;p&gt;There are over 100 HTML elements; a couple don't offer any semantic value but often need to be used more in defining a page structure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;div /&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;span /&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using elements that don't offer semantic value have their place, but contribute very little when defining the hierarchy of the page. Defining a hierarchy is helpful for users of &lt;strong&gt;AT&lt;/strong&gt; for perception, operation, and understanding. Many users of &lt;strong&gt;AT&lt;/strong&gt; use this hierarchy to navigate through a page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Using div and span by themselves offer 
a poor user experience for AT users --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;LOGO&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&amp;gt;&lt;/span&gt;home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;a&amp;gt;&lt;/span&gt;about&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;a&amp;gt;&lt;/span&gt;contact&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;Some Important Words&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;copyright&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While the visual presentation can give a little perspective to the code above, it only does a little for how an AT can interpret and provide context. The only elements with semantic value are the &lt;code&gt;anchor(&amp;lt;a/&amp;gt;)&lt;/code&gt; tags, which let the AT know that those elements are links and the user knows that they'll be navigated somewhere by interacting with them. But if we refactor the code above with accessibility in mind, we'll see something of much greater value to AT users.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- 
Using semantics provides a better user experience for AT users.
 --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;LOGO&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt; 
&lt;span class="c"&gt;&amp;lt;!-- 
I prefer not to have the Logo be the h1 element as it is a redundant item and doesn't reflect page content. 
--&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;nav&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&amp;gt;&lt;/span&gt;home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&amp;gt;&lt;/span&gt;about&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&amp;gt;&lt;/span&gt;contact&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Some Important Words Defining the Page Content&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt; 
&lt;span class="c"&gt;&amp;lt;!-- 
I prefer having my h1 reflect the content of the page,
the content of the h1 should also be similar to the unique content of 
the page title element 
--&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Some Important Words defining the Section Content&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;subheader content&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Some Important Words defining the Section Content&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;subheader content&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h4&amp;gt;&lt;/span&gt;Some Important Words defining the Article Content&lt;span class="nt"&gt;&amp;lt;/h4&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
      &lt;span class="c"&gt;&amp;lt;!--
        If the `&amp;lt;header&amp;gt;` element is used inside `&amp;lt;article&amp;gt;`and `&amp;lt;section&amp;gt;` elements are not associated 
with those elements.
        It does not get the WAI-ARIA banner role 
and needs certain behavior in assistive technologies.
      --&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h4&amp;gt;&lt;/span&gt;subheader content&lt;span class="nt"&gt;&amp;lt;/h4&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;copyright&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmp8185y8obd3gwdoq69i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmp8185y8obd3gwdoq69i.png" alt="An Abbreviated visual representation of the code snippet right before this" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By using semantics in the code example above, the hierarchy is defined using the &lt;code&gt;heading(h)&lt;/code&gt; tags, and the structure of the page is determined using the landmark tags &lt;code&gt;&amp;lt;header /&amp;gt;&lt;/code&gt;,&lt;code&gt;&amp;lt;main /&amp;gt;&lt;/code&gt;,&lt;code&gt;&amp;lt;footer /&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;nav /&amp;gt;&lt;/code&gt;. The landmarks' structures are defined by the grouping or region tags &lt;code&gt;&amp;lt;section /&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;article /&amp;gt;&lt;/code&gt;. We can now understand the architecture because we provide meaning and structure using these semantic HTML5 elements.&lt;/p&gt;

&lt;h4&gt;
  
  
  Headings and Hierarchy
&lt;/h4&gt;

&lt;p&gt;tags, ranging from 1 to 6. They represent the six levels of section headings.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; is the highest ranking in the hierarchy.

&lt;ul&gt;
&lt;li&gt;It is the most important of the levels&lt;/li&gt;
&lt;li&gt;Best practice: there should only be one &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; per page.&lt;/li&gt;
&lt;li&gt;Its content should describe the page content at the highest level&lt;/li&gt;
&lt;li&gt;The heading tags after are nested in order&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt; is the lowest in the hierarchy&lt;/li&gt;

&lt;/ul&gt;

&lt;h5&gt;
  
  
  Do
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Heading 1&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Heading 2&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Heading 3&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Don't
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Heading 1&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h4&amp;gt;&lt;/span&gt;Heading 4&lt;span class="nt"&gt;&amp;lt;/h4&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h6&amp;gt;&lt;/span&gt;Heading 6&lt;span class="nt"&gt;&amp;lt;/h6&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Nesting
&lt;/h5&gt;

&lt;p&gt;In the list below, we can see an example of how to use the &lt;code&gt;heading(h)&lt;/code&gt; tags for defining hierarchy within the page.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;h1&lt;/code&gt; Main Topic

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;h2&lt;/code&gt; h2.1 supporting main topic&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;h2&lt;/code&gt; h2.2 supporting main topic&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;h2&lt;/code&gt; h2.3 supporting main topic

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;h3&lt;/code&gt; h3.1 supporting &lt;code&gt;h2.3 &amp;gt; main&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;h3&lt;/code&gt; h3.2 supporting &lt;code&gt;h2.3 &amp;gt; main&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;h3&lt;/code&gt; h3.3 supporting &lt;code&gt;h2.3 &amp;gt; main&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;h2&lt;/code&gt; h2.4 supporting main topic

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;h3&lt;/code&gt; h3.4 supporting &lt;code&gt;h2.4 &amp;gt; main&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;h4&lt;/code&gt; h4.1 supporting &lt;code&gt;h3.4 &amp;gt; h2.4 &amp;gt; main&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;h3&lt;/code&gt; h3.5 supporting &lt;code&gt;h2.4 &amp;gt; main&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;h4&lt;/code&gt; h4.2 supporting &lt;code&gt;h3.5 &amp;gt; h2.4 &amp;gt; main&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;h4&lt;/code&gt; h4.3 supporting &lt;code&gt;h3.5 &amp;gt; h2.4 &amp;gt; main&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;h3&lt;/code&gt; h3.5 supporting &lt;code&gt;h2.4 &amp;gt; main&lt;/code&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;h3&lt;/code&gt; h3.7 supporting &lt;code&gt;h2.4 &amp;gt; main&lt;/code&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Semantics Elements for Structure
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;header /&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The top-level &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; is considered a landmark role, and the implicit ARIA &lt;code&gt;banner&lt;/code&gt; role&lt;/li&gt;
&lt;li&gt;It has different semantics depending on where it is nested

&lt;ul&gt;
&lt;li&gt;When a &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; is nested in &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, or &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;, it just identifies it as the header for that section and isn't a landmark.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ids content as navigation&lt;/li&gt;
&lt;li&gt;If nested in the top level &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, the &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; is considered the main navigation&lt;/li&gt;
&lt;li&gt;If it were nested in an &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;, it would be internal navigation for that section only&lt;/li&gt;
&lt;li&gt;Considered a landmark&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ids the main content of the document&lt;/li&gt;
&lt;li&gt;There is only one&lt;/li&gt;
&lt;li&gt;Considered a landmark&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nested in the &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Sections should have a heading, with very few exceptions&lt;/li&gt;
&lt;li&gt;Encompasses generic standalone sections of a document

&lt;ul&gt;
&lt;li&gt;When there is no more specific semantic element to use&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Articles can be nested within Sections&lt;/li&gt;

&lt;li&gt;Implicit role of &lt;code&gt;region&lt;/code&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nested in the &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Represents a complete or self-contained module of content

&lt;ul&gt;
&lt;li&gt;Independently reusable&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Implicit role of &lt;code&gt;article&lt;/code&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For content that is indirectly or tangentially related to the document's main content&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt; is also a landmark, with the implicit role of &lt;code&gt;complementary&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The main &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; is considered a landmark role and the implicit ARIA &lt;code&gt;contentinfo&lt;/code&gt; role&lt;/li&gt;
&lt;li&gt;It has no specific role if it is nested and is not a landmark if not the main &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;, the accessibility tree would call it a &lt;code&gt;FooterAsNonLAndMark&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Full List of Semantic elements in HTML:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;mark&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;summary&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;time&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Semantics" rel="noopener noreferrer"&gt;Check them out on MDN&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  The Role Attribute
&lt;/h5&gt;

&lt;p&gt;When building out your sites or apps, it is best practice to use Semantic HTML elements before using ARIA roles. The role attribute describes an element's role in the document's context. The &lt;code&gt;role&lt;/code&gt; attribute is global, so every element accepts this attribute. The &lt;code&gt;role&lt;/code&gt; is used primarily by &lt;strong&gt;AT&lt;/strong&gt;, but can be used to cast elements into different roles(&lt;em&gt;this is not recommended&lt;/em&gt;). There are six categories of ARIA roles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Document structure roles&lt;/li&gt;
&lt;li&gt;Widget roles&lt;/li&gt;
&lt;li&gt;Landmark roles&lt;/li&gt;
&lt;li&gt;Live region roles&lt;/li&gt;
&lt;li&gt;Window roles&lt;/li&gt;
&lt;li&gt;Abstract roles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more on ARIA Roles checkout the &lt;a href="https://www.w3.org/TR/wai-aria-1.2/#roles" rel="noopener noreferrer"&gt;W3C documentation on the Role Models&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Learning Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/WAI/tutorials/page-structure/" rel="noopener noreferrer"&gt;W3C Page Structure Tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webaim.org/techniques/semanticstructure/" rel="noopener noreferrer"&gt;WebAIM - Semantic Structure: Regions, Headings, and Lists&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web.dev/learn/html/semantic-html/" rel="noopener noreferrer"&gt;web.dev - Semantic HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web.dev/learn/accessibility/aria-html/" rel="noopener noreferrer"&gt;web.dev - ARIA and HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web.dev/semantics-aria/" rel="noopener noreferrer"&gt;web.dev - Introduction to ARIA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Accessibility/WAI-ARIA_basics" rel="noopener noreferrer"&gt;MDN WAI-ARIA Basics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webaim.org/techniques/aria/" rel="noopener noreferrer"&gt;WebAIM - Introduction to ARIA - Accessible Rich Internet Applications&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3) Make your Website/App Responsive
&lt;/h2&gt;

&lt;p&gt;Responsive design is good practice for multi-device experiences but can also yield good accessibility results. Some WCAG success criteria can be met by keeping responsive design in mind.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.w3.org/TR/WCAG21/#resize-text" rel="noopener noreferrer"&gt;1.4.4 Resize text&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Introduced in WCAG 2.0&lt;/li&gt;
&lt;li&gt;The page is readable and functional when the page is zoomed to 200%. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://www.w3.org/TR/WCAG21/#reflow" rel="noopener noreferrer"&gt;1.4.10 Reflow&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Introduced in WCAG 2.1&lt;/li&gt;
&lt;li&gt;No loss of content or functionality occurs, and horizontal scrolling is avoided when content is presented at a width of 320 pixels.

&lt;ul&gt;
&lt;li&gt;This requires responsive design for most websites. &lt;/li&gt;
&lt;li&gt;This is best tested by setting the browser window to 1280 pixels wide and then zooming the page content to 400%.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://www.w3.org/TR/WCAG21/#text-spacing" rel="noopener noreferrer"&gt;1.4.12 Text Spacing&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Introduced in WCAG 2.1&lt;/li&gt;
&lt;li&gt;No loss of content or functionality occurs when the user adapts paragraph spacing to 2 times the font size, text line height/spacing to 1.5 times the font size, word spacing to .16 times the font size, and letter spacing to .12 times the font size.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tips for Responsive Design
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use the viewport meta tag&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;match the screen's width in device-independent pixels by setting &lt;code&gt;content=" width=device-width&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Establish a 1:1 relationship between CSS pixels and device-independent pixels by setting &lt;code&gt;initial-scale=1.0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Instructs the browser to fit your content to the screen size
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Don't disable zooming&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;avoid these settings:&lt;code&gt;maximum-scale=1&lt;/code&gt; or &lt;code&gt;user-scaleable=no&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Use relative units for text&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This will enable the whole site to reflow as the user zooms, creating the reading experience they need to use your site.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;em&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;This unit of measure adjusts relative to the parent element&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;rem&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;This unit of measure adjusts relative to the &lt;code&gt;root&lt;/code&gt; element&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Keep DOM order and Visual order connected&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don't use CSS to reorder the HTML elements. It can confuse tab order as well as folks that use screen readers in combination with the visual presentation.&lt;/li&gt;
&lt;li&gt;Use CSS Grid and Flex-box appropriately

&lt;ul&gt;
&lt;li&gt;Utilize the flexible nature of these layout methods. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Learning Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.codecademy.com/learn/responsive-design-and-accessibility/modules/learn-responsive-design-module/cheatsheet" rel="noopener noreferrer"&gt;Codecademy - Cheatsheets/Responsive Design and Accessibility&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web.dev/responsive-web-design-basics/" rel="noopener noreferrer"&gt;web.dev - Responsive web design basics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://relatablecode.com/make-your-website-more-accessible-with-these-responsive-design-tips" rel="noopener noreferrer"&gt;Make your website more accessible with these Responsive Design tips&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web.dev/accessible-responsive-design/" rel="noopener noreferrer"&gt;web.dev - Accessible responsive design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.boia.org/blog/responsive-design-and-accessibility#:~:text=A%20responsive%20design%20creates%20a,technology%20such%20as%20screen%20readers." rel="noopener noreferrer"&gt;BIA - Responsive Design and Accessibility&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those are just three easy ways to start incorporating accessibility into your developing practice. &lt;/p&gt;

&lt;p&gt;Give this post a reaction if you found it helpful, and follow me on &lt;a href="https://twitter.com/stories_of_ren" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; and &lt;a href="https://dev.to/stories_of_ren"&gt;Dev.to&lt;/a&gt; to keep up with new posts!&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>webdev</category>
      <category>discuss</category>
    </item>
    <item>
      <title>How to serve your Datastream directly to your PDF Viewer</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Mon, 12 Sep 2022 18:23:58 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/how-to-serve-your-datastream-directly-to-your-pdf-viewer-1nc</link>
      <guid>https://forem.com/stories_of_ren/how-to-serve-your-datastream-directly-to-your-pdf-viewer-1nc</guid>
      <description>&lt;p&gt;I recently learned about Stream data and how to feed it directly into the PDF viewer I am using. The solution was fairly easy, but it took me a bit to find it and understand what was happening. &lt;/p&gt;

&lt;h2&gt;
  
  
  A little context
&lt;/h2&gt;

&lt;p&gt;On this project I am using NextJS, MinIO (To access my s3 Buckets), and React PDF Viewer.  I'm using NextJS at it's base setup for the api, so that means I'm using the inherent api directory in pages.  I am very fond of the auto-magic routing system they've got going on in the background there. Now you are probably wondering why I need to feed the data directly from the API. The S3 Bucket for this project was configured to only be available within our K8s(Kubernetes) cluster, this means I could not use a pre-signed URL to fetch the document from the browser because the browser is outside or the cluster.  Thus I needed a way to retrieve the Data from within the cluster.  This lead to serving up the data directly from the API. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.min.io/docs/javascript-client-quickstart-guide.html" rel="noopener noreferrer"&gt;MinIO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://react-pdf-viewer.dev/" rel="noopener noreferrer"&gt;React PDF Viewer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nextjs.org/docs/getting-started" rel="noopener noreferrer"&gt;NextJS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample NextJS Structure&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├─ app
    ├── components
    ├── lib &amp;lt;-- custom
    │   ├── **/*.ts
    │   ├── minio.ts
    └── pages
        ├── api
        │   ├──[documentId].ts
        └── index.tsx

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  MinIO
&lt;/h2&gt;

&lt;p&gt;I am working with the &lt;a href="https://docs.min.io/docs/javascript-client-api-reference.html" rel="noopener noreferrer"&gt;MinIO JavaScript Client SDK&lt;/a&gt;, so I can make my MinIO connections in the API.&lt;/p&gt;

&lt;p&gt;I first set up a MinIo config file that has my client definition where I feed in environment variables to connect to my AWS S3 bucket and the methods I need for my app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;Minio&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;minio&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lib/config&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Readable&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;stream&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NextApiResponse&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;BUCKET_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;BUCKET_HOST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;BUCKET_PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;AWS_ACCESSKEY_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;AWS_SECRET_ACCESS_KEY&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;minio&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;Minio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Client&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;global&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;minio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
        &lt;span class="nb"&gt;global&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;minio&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Minio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;endPoint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;BUCKET_HOST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;BUCKET_PORT&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="na"&gt;useSSL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
            &lt;span class="na"&gt;accessKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;AWS_ACCESSKEY_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;AWS_SECRET_ACCESS_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;global&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;minio&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Checks if Bucket exists, create bucket if it does not&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;upsertMinioBucket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;minioClient&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Minio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bucketExists&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;minioClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bucketExists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;BUCKET_NAME&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bucketExists&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;minioClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;makeBucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;BUCKET_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;us-east-1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;minioClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bucketExists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;BUCKET_NAME&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="c1"&gt;// Upload file to bucket and returns with object =&amp;gt; (err| objInfo)&lt;/span&gt;
&lt;span class="c1"&gt;// Uploads contents from a file to objectName.&lt;/span&gt;
&lt;span class="c1"&gt;// fPutObject(bucketName, objectName, filePath, metaData[, callback])&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;upsertMinioFile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;minioClient&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Minio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;objectMade&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;minioClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fPutObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;BUCKET_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{});&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;objectMade&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="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;loadMinioStream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;minioClient&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Minio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[])&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;minioClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;BUCKET_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;streamToResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Readable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NextApiResponse&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;end&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;error&lt;/span&gt;&lt;span class="dl"&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;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;getObject&lt;/code&gt;+  &lt;code&gt;streamToResponse&lt;/code&gt; = ❤️
&lt;/h2&gt;

&lt;p&gt;In the API route &lt;code&gt;[documentId].ts&lt;/code&gt;, I use the MinIO Object operation &lt;code&gt;getObject&lt;/code&gt; and custom method for for running through the stream data to write the stream directly to the response.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NextApiRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;NextApiResponse&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;runMiddleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lib/middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;CORS&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cors&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;minio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;loadMinioStream&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;streamToResponse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;upsertMinioBucket&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lib/minio&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;minio&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// Initializing the cors middleware&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;runMiddleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nc"&gt;CORS&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&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;GET&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;POST&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;OPTIONS&lt;/span&gt;&lt;span class="dl"&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NextApiRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NextApiResponse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;documentId&lt;/span&gt; &lt;span class="o"&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;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;_req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;getDocumentStream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;documentId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getDocumentStream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;documentId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NextApiResponse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;exists&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;upsertMinioBucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="na"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;exists&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;loadMinioStream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;documentId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;resolve&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;streamToResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;resolve&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="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Feeding into React PDF Viewer
&lt;/h2&gt;

&lt;p&gt;So then to get my file to show up into the PDF viewer, I feed it my API route as the &lt;code&gt;fileURL&lt;/code&gt;, and Blam it's there.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;PDFViewer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;}){&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setFilePath&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;workerUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://unpkg.com/pdfjs-dist@2.14.305/legacy/build/pdf.worker.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


    &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`//&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;}${&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/api/documents/pdf/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;80&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="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nf"&gt;setFilePath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&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="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Worker&lt;/span&gt; &lt;span class="na"&gt;workerUrl&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;workerUrl&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Viewer&lt;/span&gt; &lt;span class="na"&gt;fileUrl&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;  &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Worker&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;



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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This particular solution is not specific to a PDF, it could be used in cases of images, binary, etc.&lt;/p&gt;

&lt;p&gt;If you have made it to this point, I would like to say congrats! You made it to the end! As a reward I present to you this gif!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4uqq12hkyfjxfjq16v1i.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4uqq12hkyfjxfjq16v1i.gif" alt="A T-rex clapping because you've done well" width="700" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>nextjs</category>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>Getting to Know the Basics of Nuxt Automatic Routing</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Thu, 20 Jan 2022 17:24:46 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/getting-to-know-the-basics-of-nuxt-automatic-routing-253i</link>
      <guid>https://forem.com/stories_of_ren/getting-to-know-the-basics-of-nuxt-automatic-routing-253i</guid>
      <description>&lt;p&gt;To really understand how cool Nuxt's automatic routing is, you need to understand how to set up a router in a traditional Vue project. But why do you need to know that? It is because Nuxt uses &lt;a href="https://router.vuejs.org/guide/#html" rel="noopener noreferrer"&gt;&lt;code&gt;vue-router&lt;/code&gt;&lt;/a&gt;. Now the fastest way to set up a router in a vue project is to use the &lt;a href="https://cli.vuejs.org/guide/installation.html" rel="noopener noreferrer"&gt;&lt;code&gt;Vue CLI&lt;/code&gt; tool&lt;/a&gt;, so you can have template for setting up your router.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up a Vue app router
&lt;/h2&gt;

&lt;p&gt;The file tree for the Vue router set up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
--| assets/
--| components/
--| router/
-----| index.js
--| views/
-----| Home.vue
-----| About.vue
--| App.vue
--| main.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the CLI tools helps setting up the router much faster by providing a template to follow, however whenever you need to add pages you need to manually add routes to the router configurations you see below.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://router.vuejs.org/guide/#javascript" rel="noopener noreferrer"&gt;&lt;code&gt;src/router/index.js&lt;/code&gt;&lt;/a&gt; 1
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createRouter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;createWebHashHistory&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue-router&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../views/Home.vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;About&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../views/About.vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;routes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Home&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Home&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="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/about&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;About&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;// route level code-splitting&lt;/span&gt;
    &lt;span class="c1"&gt;// this generates a separate chunk (about.[hash].js) for this route&lt;/span&gt;
    &lt;span class="c1"&gt;// which is lazy-loaded when the route is visited.&lt;/span&gt;
    &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../views/About.vue&lt;/span&gt;&lt;span class="dl"&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createRouter&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;history&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;createWebHashHistory&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="nx"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;a href="https://router.vuejs.org/guide/#html" rel="noopener noreferrer"&gt;&lt;code&gt;src/App.vue&lt;/code&gt;&lt;/a&gt; 2
&lt;/h3&gt;

&lt;p&gt;When adding navigation to the router you use a &lt;code&gt;&amp;lt;router-link/&amp;gt;&lt;/code&gt; and use the &lt;code&gt;&amp;lt;router-view/&amp;gt;&lt;/code&gt; for rending the component of the mapped path.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"nav"&lt;/span&gt;&lt;span class="nt"&gt;&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;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/router-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;"/about"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;router-view&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;style&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nf"&gt;#app&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Avenir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Helvetica&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Arial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-font-smoothing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;antialiased&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;-moz-osx-font-smoothing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grayscale&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&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="m"&gt;#2c3e50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;#nav&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;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;#nav&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bold&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="m"&gt;#2c3e50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;#nav&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nc"&gt;.router-link-exact-active&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="m"&gt;#42b983&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;style&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;a href="https://router.vuejs.org/guide/#html" rel="noopener noreferrer"&gt;&lt;code&gt;src/main.js&lt;/code&gt;&lt;/a&gt; 3
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createApp&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./App.vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./router&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;createApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;use&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="nf"&gt;mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&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;p&gt;Alright you probably thinking, with the CLI tool setting up a router doesn't seem tedious at all. Well that is true, it's just a little extra work to have to add to or adjust the route mapping and App template. Nuxt, which is based in Vue, has automatic routing, as in it Auto-magically adds to the route mapping and templates. So essentially all you need to do to make routing work is put &lt;code&gt;.vue&lt;/code&gt; files in the &lt;code&gt;pages&lt;/code&gt; directory and blam routing.&lt;/p&gt;

&lt;p&gt;The file tree for Nuxt automatic routing:&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Routes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;components/
layouts/
pages/
--| index.vue
--| About.vue

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

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;vue-router&lt;/code&gt; there's the &lt;code&gt;&amp;lt;router-link/&amp;gt;&lt;/code&gt; to navigate to the app's internal pages within the router, in Nuxt the component is &lt;code&gt;&amp;lt;NuxtLink/&amp;gt;&lt;/code&gt;, both have &lt;code&gt;to="#"&lt;/code&gt; attribute, which acts like the &lt;code&gt;href&lt;/code&gt; of the anchor tag &lt;code&gt;&amp;lt;a href="#" /&amp;gt;&lt;/code&gt;. That being said the &lt;code&gt;&amp;lt;NuxtLink/&amp;gt;&lt;/code&gt; is only used for Internal navigation, any external navigation should use anchor tags.&lt;/p&gt;

&lt;p&gt;So in terms of how the basic routes are generated, let's reference the Nuxt automatic routing file tree above, and explore the router object that would be created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;routes&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;index&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pages/index.vue&lt;/span&gt;&lt;span class="dl"&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;About&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/about&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pages/About.vue&lt;/span&gt;&lt;span class="dl"&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="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When creating an &lt;code&gt;index.vue&lt;/code&gt; file within the top level of the &lt;code&gt;pages&lt;/code&gt; directory, this automatically will have the base path &lt;code&gt;/&lt;/code&gt; assigned to it. When the files are named it will create a path associated with the what you've named the &lt;code&gt;.vue&lt;/code&gt; file. Additionally you can create Dynamic routes and Nesting routes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dynamic Routes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;components/
layouts/
pages/
--| index.vue
--| _slug/
-----| index.vue
--| users/
-----| _id.vue

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

&lt;/div&gt;



&lt;p&gt;Dynamic routes are routes where the name of the route includes unique identifiers and/or are unknown. A good example of this is if you are going to specific user's profile page, like: &lt;code&gt;someSite.com/userID&lt;/code&gt;. In Nuxt we create dynamic link by adding an underscore to the beginning of the name of the route, like we see in the file tree above with &lt;code&gt;_slug.vue&lt;/code&gt; and &lt;code&gt;users/_id.vue&lt;/code&gt;. You can have both dynamic directories and dynamic routes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nested Routes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;components/
layouts/
pages/
--| index.vue
--| users/
-----| _id.vue
--| users.vue

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

&lt;/div&gt;



&lt;p&gt;Nested routes are created when a directory and a &lt;code&gt;.vue&lt;/code&gt; file are at the same level and named the same, you can see an example of this above in the file tree for nested routes.&lt;/p&gt;

&lt;p&gt;Creating these more complex file trees for the routing system still creates a router object similar to the basic routes, but a little different, specifically in terms of the nested routes. Below is an example holding both dynamic routes and nested.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;routes&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;index&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pages/index.vue&lt;/span&gt;&lt;span class="dl"&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;About&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/about&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pages/About.vue&lt;/span&gt;&lt;span class="dl"&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="c1"&gt;// this is the basic nested route&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/blog&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pages/blog.vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;children&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/blog/:id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pages/blog/_id.vue&lt;/span&gt;&lt;span class="dl"&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="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// this is the basic dynamic route&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;User&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/user/:id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pages/user/_id.vue&lt;/span&gt;&lt;span class="dl"&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="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When creating your routes, you can locally access the route params at both the page and component level. You can gain access through referencing &lt;code&gt;this.$route.params.{parameterName}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And there are the basics surrounding the coolness of the Nuxt Automatic Routing system. If you wanted to learn more about Nuxt router you can checkout how to extend the Nuxt router, reading about it in the Nuxt Docs under the &lt;a href="https://nuxtjs.org/docs/features/file-system-routing#extending-the-router" rel="noopener noreferrer"&gt;File System Routing Feature: Extending the Router&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://router.vuejs.org/guide/#html" rel="noopener noreferrer"&gt;&lt;code&gt;vue-router&lt;/code&gt; Router Javascript Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://router.vuejs.org/guide/#html" rel="noopener noreferrer"&gt;&lt;code&gt;vue-router&lt;/code&gt; App.vue&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cli.vuejs.org/guide/" rel="noopener noreferrer"&gt;Example code for main.js is pulled for a test app made with the CLI tool&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>vue</category>
      <category>nuxt</category>
    </item>
    <item>
      <title>Getting to Know Web Vitals!</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Tue, 11 Jan 2022 19:02:27 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/getting-to-know-web-vitals-159i</link>
      <guid>https://forem.com/stories_of_ren/getting-to-know-web-vitals-159i</guid>
      <description>&lt;h2&gt;
  
  
  What are Web Vitals?
&lt;/h2&gt;

&lt;p&gt;In a recent project, my NextJS with Material UI deployment has been loading the initial render slow. So I am learning the debugging process behind that performance lag, which has me getting to know the Web Vitals a bit better. And I thought I'd share what I've learned thus far with you.&lt;/p&gt;

&lt;p&gt;I can gain access to the Web Vitals in a few different places, but currently I just want the value output so I'm using the &lt;code&gt;reportWebVitals&lt;/code&gt; function that is inherit in NextJS and logging them out for quick access, for more detail and suggestions I can run a &lt;a href="https://developers.google.com/web/tools/lighthouse/" rel="noopener noreferrer"&gt;Lighthouse&lt;/a&gt; report.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsiol3thwdgdfk2gqhb57.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsiol3thwdgdfk2gqhb57.png" alt="Lighthouse Performance Report, reading a score of 97 for Ren Estep dot com" width="800" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Web Vitals
&lt;/h3&gt;

&lt;p&gt;In the simplest terms, Web vitals are useful metrics that help in the examination of the user experience of a webpage. They are an &lt;a href="https://web.dev/vitals/" rel="noopener noreferrer"&gt;initiative from Google&lt;/a&gt;, that hope to simplify and help focus evaluations to what matters most, these culminate into the &lt;strong&gt;Core Web Values&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  So what are the &lt;strong&gt;Core Web Values&lt;/strong&gt;?
&lt;/h3&gt;

&lt;p&gt;A subset of web vitals that can be applied to all web pages, should be examined and weight by site owners, and have a thread to all the Google tools. The subsets, each has a reference to a specific type of user experience. These references provide measurements and can reflect critical user-centric outcomes.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Core Web Vitals:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;LCP: Largest Contentful Paint&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FID: First Input Delay&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CLS: Cumulative Layout Shift&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The metrics listed above are used in measuring important performance elements of user experience, when interacting with a webpage. If you were running a Lighthouse report, the thresholds that are reflected for each metric helps define the performance score for the webpage you're reviewing. Below the Core Web Vitals are expanded upon, along with other metrics that are available through the &lt;code&gt;reportWebVitals&lt;/code&gt;, which include Web Vitals and NextJS specific metrics.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Web Vitals metrics I have access to through the &lt;code&gt;reportWebVitals&lt;/code&gt; method:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;TTFB: Time To First Byte&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This metric refers to the time it takes to receive the first byte of information after the browser request it.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;code&gt;FCP: First Contentful Paint&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The metric reflect the time to the first bit of content rendered to the DOM.&lt;/li&gt;
&lt;li&gt;This is where a user can start consuming page content.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;LCP: Largest Contentful Paint&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This metrics measures loading performance, for "Good UX", loading should take between 0 and 2.5 seconds.&lt;/li&gt;
&lt;li&gt;Using the &lt;code&gt;reportWebVitals&lt;/code&gt;, the value is represented in milliseconds&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;FID: First Input Delay&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A metric for measuring Load responsiveness, when this number is low the site is typically easier to use and navigate.&lt;/li&gt;
&lt;li&gt;The perception of the end user's experience while interacting with the web page.&lt;/li&gt;
&lt;li&gt;It help measure the time from when the user first interacts with the page to the time when the browser processes the interaction.&lt;/li&gt;
&lt;li&gt;For "Good UX", that time should fall between 0 and 100 milliseconds&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;CLS: Cumulative Layout Shift&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A metric for measuring visual stability.&lt;/li&gt;
&lt;li&gt;This measures the largest burst of layout shifts that are unexpected through out the life of a page.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Additional NextJS Specific Metrics:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Next.js-hydration&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This measures the length of time from start to finish, it takes a page to Hydrate in milliseconds.&lt;/li&gt;
&lt;li&gt;What is Hydration?&lt;/li&gt;
&lt;li&gt;The process of attaching react listeners to HTML-DOM nodes.&lt;/li&gt;
&lt;li&gt;Rehydration is basically the same, but in reference to Server Side Rendered(SSR) rendered HTML. The listeners still need to be attached.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;code&gt;Next.js-route-change-to-render&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How long it takes a page to start rendering after a route change.&lt;/li&gt;
&lt;li&gt;It is measured in Milliseconds.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;code&gt;Next.js-render&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How long it takes a page to finish rendering after a route change.&lt;/li&gt;
&lt;li&gt;It is measured in Milliseconds.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Thoughts on improving the &lt;strong&gt;Core Web Values&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;LCP: Largest Contentful Paint&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove unnecessary 3rd part scripts&lt;/li&gt;
&lt;li&gt;Set up Lazy or Dynamic loading, Loading components only when they are needed&lt;/li&gt;
&lt;li&gt;Remove large page elements&lt;/li&gt;
&lt;li&gt;Minify your CSS&lt;/li&gt;
&lt;li&gt;Upgrade your hosting&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;code&gt;FID: First Input Delay&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimize JavaScript, page interactions are slowed down if the page is loading javascript.&lt;/li&gt;
&lt;li&gt;Remove any unnecessary 3rd party scripts&lt;/li&gt;
&lt;li&gt;Use a browser caching&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;code&gt;CLS: Cumulative Layout Shift&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set size attributes for any medias types&lt;/li&gt;
&lt;li&gt;Ads should have reserved space, placeholders&lt;/li&gt;
&lt;li&gt;Adding new UI elements should happen in a way that they don't unexpectedly push content down or over.&lt;/li&gt;
&lt;li&gt;Avoid content shifting around the page.&lt;/li&gt;
&lt;li&gt;Dynamically/ lazy load components&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;I'm in the process of testing out different solutions, for my larger numbers. I'm looking at rendering a static page initially, fingers crossed it's the first solution (&lt;em&gt;we all know it never is&lt;/em&gt;)! It's been a joy learning as new development opportunities that have come with bigger responsibilities. I hope my notes help on your learning path as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://web.dev/vitals/" rel="noopener noreferrer"&gt;Web.dev Web Vitals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://backlinko.com/hub/seo/core-web-vitals" rel="noopener noreferrer"&gt;BACKLINKO User Experience Signals: Core Web Vitals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nextjs.org/docs/advanced-features/measuring-performance#build-your-own" rel="noopener noreferrer"&gt;NextJS Web Vitals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nextjs.org/learn/seo/improve" rel="noopener noreferrer"&gt;NextJs Learn: Improving Your Core Web Vitals&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>nextjs</category>
      <category>corewebvitals</category>
    </item>
    <item>
      <title>5 Free Awesome Resources to Start Learning Accessibility!</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Sat, 18 Sep 2021 15:43:06 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/5-free-awesome-resources-to-start-learning-accessibility-2n9p</link>
      <guid>https://forem.com/stories_of_ren/5-free-awesome-resources-to-start-learning-accessibility-2n9p</guid>
      <description>&lt;p&gt;If it is your goal to start learning about accessibility, any one of these resources could help you on your journey!  They are beginner level and most importantly free!  Learning accessibility is not only beneficial for you, but it also benefits your friends, your place of business, and society!  It was made abundantly clear how much accessibility is needed in technology during the quarantine, when many people were unable to have physical access to resources without using the web. In terms of social inclusion accessibility also support people in rural areas, people in developing countries, and older people. All-in-all getting a start on learning accessibility is helpful for everyone.     &lt;/p&gt;

&lt;h2&gt;
  
  
  W3C Web Accessibility Initiative's &lt;a href="https://www.w3.org/WAI/fundamentals/accessibility-intro/" rel="noopener noreferrer"&gt;Introduction to Web Accessibility&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;"&lt;em&gt;When websites and web tools are properly designed and coded, people with disabilities can use them.&lt;/em&gt;"&lt;/p&gt;

&lt;h3&gt;
  
  
  Key points:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Strong introduction to what accessibility is including examples of different types of disabilities.&lt;/li&gt;
&lt;li&gt;Helpful resources for going further into accessibility throughout.&lt;/li&gt;
&lt;li&gt;Short videos to help with explanations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://a11y-101.com/" rel="noopener noreferrer"&gt;A11y 101&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;"&lt;em&gt;The goal is to make it as easy as possible for people who use assistive technology like screen reader software while also pointing out how things will change the web experience.&lt;/em&gt;"&lt;/p&gt;

&lt;h3&gt;
  
  
  Key points:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use of scenarios in explaining accessibility and bias toward disabilities.&lt;/li&gt;
&lt;li&gt;Writing style is conversational and easy to understand.&lt;/li&gt;
&lt;li&gt;Covers base topics in Design and Development to start working toward creating accessible content and code. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Udacity:&lt;a href="https://www.udacity.com/course/web-accessibility--ud891" rel="noopener noreferrer"&gt;Web Accessibility by Google&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;"In this course you’ll get hands-on experience making web applications accessible."&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key points:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This course is lesson based.&lt;/li&gt;
&lt;li&gt;Video based some times featuring additional text based information.&lt;/li&gt;
&lt;li&gt;Gives reference and resources on specific topics that videos are talking to.&lt;/li&gt;
&lt;li&gt;Covers a base in Development needs, but is good for anyone looking to learn about accessibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Coursera: &lt;a href="https://www.coursera.org/learn/accessibility" rel="noopener noreferrer"&gt;An Introduction to Accessibility and Inclusive Design&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;"&lt;em&gt;This course introduces some of the fundamental principles of accessibility and prepares learners for further study in accessibility and inclusive design.&lt;/em&gt;"&lt;/p&gt;

&lt;h3&gt;
  
  
  Key points:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Enrollment is similar to auditing a class.&lt;/li&gt;
&lt;li&gt;Breaks course up into a 4 week learning schedule.&lt;/li&gt;
&lt;li&gt;Video based, with reading and practices exercises (quizzes).&lt;/li&gt;
&lt;li&gt;Course covers a base understanding of disabilities and what accessibility is, legal parameters, POUR and WCAG 2.0, and material that need to be considered for accessibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Course is offered by University of Illinois at Urbana-Champaign.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Coursera: &lt;a href="https://www.coursera.org/projects/introduction-to-accessible-web-development" rel="noopener noreferrer"&gt;Introduction to Accessible Web Development, a guided project&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;A guided project, where you will learn the basics of accessible web development.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key points:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Project based for learning accessible web development.&lt;/li&gt;
&lt;li&gt;Use of an online IDE, featuring a side-by-side video tutorial.&lt;/li&gt;
&lt;li&gt;Listed as intermediate&lt;/li&gt;
&lt;li&gt;Topics covered:

&lt;ul&gt;
&lt;li&gt;Assistive Technology&lt;/li&gt;
&lt;li&gt;Semantic HTML&lt;/li&gt;
&lt;li&gt;Focus / Tab Index&lt;/li&gt;
&lt;li&gt;Basic ARIA usage&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Is offered by coursera project network.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How Cool is Nuxt?</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Tue, 24 Aug 2021 18:38:56 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/how-cool-is-nuxt-23ce</link>
      <guid>https://forem.com/stories_of_ren/how-cool-is-nuxt-23ce</guid>
      <description>&lt;p&gt;I recently updated my personal resume website, and I thought it would be a good opportunity to refresh on Vue and learn &lt;a href="https://nuxtjs.org/" rel="noopener noreferrer"&gt;NuxtJs&lt;/a&gt;. So, I thought I'd give a run through of my experience.&lt;/p&gt;

&lt;p&gt;The general setup of Nuxt is pretty self explanatory with in its stepper. They've got setup docs for &lt;code&gt;yarn&lt;/code&gt;, &lt;code&gt;npx&lt;/code&gt;, and &lt;code&gt;npm&lt;/code&gt;.  I went through the &lt;code&gt;npx&lt;/code&gt; choose your own adventure setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose Your own adventure: &lt;code&gt;npx&lt;/code&gt; style
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-nuxt-app &amp;lt;project-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you journey through the &lt;code&gt;npx create-nuxt-app&lt;/code&gt; route, you will be asked many questions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What Package manager?&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;yarn&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;What programming language?&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Do you want a UI Framework?&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.antdv.com/docs/vue/introduce/" rel="noopener noreferrer"&gt;Ant Design Vue&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://material.balmjs.com/#/" rel="noopener noreferrer"&gt;BalmUI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bootstrap-vue.org/" rel="noopener noreferrer"&gt;Bootstrap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://buefy.org/" rel="noopener noreferrer"&gt;Buefy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://chakra-ui.com/" rel="noopener noreferrer"&gt;Chakra UI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://madewithvuejs.com/element-ui" rel="noopener noreferrer"&gt;Element&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://framevuerk.com/" rel="noopener noreferrer"&gt;Framevuerk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://oruga.io/" rel="noopener noreferrer"&gt;Oruga&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tachyons.io/components/" rel="noopener noreferrer"&gt;Tachyons&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tailwindcss.com/docs/guides/vue-3-vite" rel="noopener noreferrer"&gt;Tailwind CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://windicss.org/integrations/vue-cli.html" rel="noopener noreferrer"&gt;Windi CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youzan.github.io/vant/#/en-US/" rel="noopener noreferrer"&gt;Vant&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/view-design/ViewUI" rel="noopener noreferrer"&gt;View UI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vuetifyjs.com/en/" rel="noopener noreferrer"&gt;Vuetify&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Nuxt.js modules:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Axios - Promise based HTTP client&lt;/li&gt;
&lt;li&gt;Progressive Web App (PWA)&lt;/li&gt;
&lt;li&gt;Content - Git-based headless CMS&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Linting tools:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;ESLint&lt;/li&gt;
&lt;li&gt;Prettier&lt;/li&gt;
&lt;li&gt;Lint staged files&lt;/li&gt;
&lt;li&gt;StyleLint&lt;/li&gt;
&lt;li&gt;Commitlint&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Testing framework:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;None&lt;/li&gt;
&lt;li&gt;Jest&lt;/li&gt;
&lt;li&gt;AVA&lt;/li&gt;
&lt;li&gt;WebdriverIO&lt;/li&gt;
&lt;li&gt;Nightwatch&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Rendering mode&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Universal (SSR / Static)&lt;/li&gt;
&lt;li&gt;SPA&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Deployment target&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Server (Node.js hosting)&lt;/li&gt;
&lt;li&gt;Static (Static/JAMStack hosting)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Development tools&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;jsconfig.json&lt;/li&gt;
&lt;li&gt;Semantic PR&lt;/li&gt;
&lt;li&gt;Dependabot (for GitHub only)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Continuous Integration&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Actions&lt;/li&gt;
&lt;li&gt;Travis CI&lt;/li&gt;
&lt;li&gt;CircleCI&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  My route:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;npm&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;No UI framework&lt;/li&gt;
&lt;li&gt;Axios&lt;/li&gt;
&lt;li&gt;ESLint, Prettier, Stylelint, Lint staged files&lt;/li&gt;
&lt;li&gt;Like a horrible person I didn't add a testing library&lt;/li&gt;
&lt;li&gt;SPA&lt;/li&gt;
&lt;li&gt;Static (I deploy to github pages)&lt;/li&gt;
&lt;li&gt;jsConfig, Dependabot&lt;/li&gt;
&lt;li&gt;No CI &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted a really clean slate to work with, but you can obviously manipulate or add in some of these options later if you find you need them.&lt;/p&gt;

&lt;p&gt;Once you are all built, you can head into your directory!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd &amp;lt;project-name&amp;gt;
npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Me though, I chose a more dangerous and tedious route:
&lt;/h3&gt;

&lt;p&gt;My previous code base was a &lt;code&gt;create-react-app&lt;/code&gt;. I created a new branch and carefully removed that information making sure not to delete items that would remove my connection to &lt;code&gt;git&lt;/code&gt; then copied over my new Nuxt project into the directory. Once everything was correctly manipulated then I could &lt;code&gt;npm run dev&lt;/code&gt;. &lt;br&gt;
&lt;em&gt;There was probably an easier way to do this, but I sometimes just impulsively start things without thinking, when trying to learn new things... oops&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Up until this point, I had been using react based frameworks.  Most recently, I had been using &lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;NextJS&lt;/a&gt;, which has a lot in common functionally as NuxtJS. Both have an opinionated routing system, meaning it's built in, which made setup go much faster.  It was kind of auto-magical! But because of my experience with Next it made working in Nuxt a bit easier.    &lt;/p&gt;
&lt;h2&gt;
  
  
  Project Setup, Time to build
&lt;/h2&gt;

&lt;p&gt;After getting my project setup and my new branch pushed to Github, I felt it was safe to start adding and adjusting content as I saw fit. &lt;br&gt;
...&lt;/p&gt;
&lt;h3&gt;
  
  
  Cool things about Nuxt
&lt;/h3&gt;

&lt;p&gt;Nuxt has a present directory structure that helps in the dynamic and auto importing.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;My Fave Things&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Components

&lt;ul&gt;
&lt;li&gt;The auto imports is available v2.13+&lt;/li&gt;
&lt;li&gt;Easy to use Lazy loading, by just prefixing &lt;code&gt;Lazy&lt;/code&gt; to the front of you component.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;LazyTheFooter /&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Using the lazy prefix you can also dynamically import a component when an event is triggered.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Layouts

&lt;ul&gt;
&lt;li&gt;This may be more in line with liking the templating feature in Vue, but I dig the reusable layouts. On my personal resume site I really only extended the default layout, but the fact that I can create different layouts for specific templates is just cool.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Pages

&lt;ul&gt;
&lt;li&gt;I mentioned before that Nuxt like Next has an opinionated routing system.  The router is built-in, cool right? Well not half as cool as the router configurations being automatically created for me just by adding my files to the &lt;code&gt;Pages&lt;/code&gt; Directory!!!! &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm using &lt;a href="https://github.com/dependabot" rel="noopener noreferrer"&gt;Dependabot&lt;/a&gt;, for the first time, I'm like it so far also.  It's kind of like how My cats tell me if they need fed, but plants don't... as in the Dependabot tells me about when my Dependencies need updating and if I relied on my own watchful eyes, the dependencies would probably die like any plants I've tried to keep.&lt;/p&gt;

&lt;p&gt;Coolest thing about Nuxt, It has great Documentation! It's pretty understandable and followable.&lt;/p&gt;
&lt;h3&gt;
  
  
  The things I needed to add or change
&lt;/h3&gt;

&lt;p&gt;I needed to update a few things.  I needed to add a &lt;code&gt;.stylelintignore&lt;/code&gt;, to ignore the &lt;code&gt;.nuxt&lt;/code&gt; directory, it was not thrilled with how some of the css was being built out and was refusing to commit because of it.  I could have updated the rules to include it, but I actually like the rule it was breaking, in the end I guess that is a linting preference.  That being said, I'm thrilled that they included &lt;a href="https://stylelint.io/" rel="noopener noreferrer"&gt;stylelint&lt;/a&gt; in the Nuxt template creation.  It's my go to for style linting now-a-days. &lt;/p&gt;
&lt;h2&gt;
  
  
  The site is built! Time to Deploy!
&lt;/h2&gt;

&lt;p&gt;Well I mean the site has content.  That means it's time to generate the static build and publish. &lt;/p&gt;
&lt;h3&gt;
  
  
  Generate for static.
&lt;/h3&gt;

&lt;p&gt;The first step in deploying is generating the build the static web app. And you do that by running the &lt;code&gt;generate&lt;/code&gt; script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run generate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a &lt;code&gt;dist&lt;/code&gt; directory.  It contains everything I needed to deploy to my Github pages site.&lt;/p&gt;

&lt;p&gt;After running this script you will need to commit your changes at the very least, because if you try to deploy with the changes not committed, you will receive a error in deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://nuxtjs.org/docs/2.x/deployment/github-pages#deploying-to-github-pages-for-repository" rel="noopener noreferrer"&gt;Deploy to &lt;code&gt;gh-pages&lt;/code&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The deploying documentation is stellar! It's also not limited to GitHub and that's pretty darn cool!&lt;br&gt;
But for GitHub you want use &lt;a href="https://github.com/L33T-KR3W/push-dir" rel="noopener noreferrer"&gt;&lt;code&gt;push-dir&lt;/code&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install push-dir --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you add the &lt;code&gt;deploy&lt;/code&gt; script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"deploy": "push-dir --dir=dist --branch=gh-pages --cleanup"
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then like magic my site would be deployed and be live pretty quickly!  &lt;/p&gt;

&lt;h2&gt;
  
  
  Last Impressions
&lt;/h2&gt;

&lt;p&gt;Nuxt is cool and handy for getting a quick start!  I would recommend this more for refreshing on VueJS rather than trying to learn both how to work in Nuxt and writing VueJS templates.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>vue</category>
      <category>nuxt</category>
    </item>
    <item>
      <title>5 tools for Designing, Developing, and Testing Accessibility</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Tue, 20 Jul 2021 19:58:47 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/5-tools-for-designing-developing-and-testing-accessibility-5a0d</link>
      <guid>https://forem.com/stories_of_ren/5-tools-for-designing-developing-and-testing-accessibility-5a0d</guid>
      <description>&lt;p&gt;No matter what you are working on, considering accessibility is definitely a best practice.  Below is a list of five tools to help get you started with accessibility in your projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.getstark.co/" rel="noopener noreferrer"&gt;Stark&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;This tool provides a wide array of color and contrast checking abilities along with simulators to test you design again visual disabilities.
&lt;/li&gt;
&lt;li&gt;Stark has plugins to go in various design tools, but also in chrome.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi6jtdfwoy1kym5vrms02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi6jtdfwoy1kym5vrms02.png" alt="Stark as a Google Chrome extension" width="766" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.deque.com/axe/devtools/" rel="noopener noreferrer"&gt;Deque's Dev tools AXE extension&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;There are extensions/add-ons for &lt;a href="https://chrome.google.com/webstore/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd?hl=en" rel="noopener noreferrer"&gt;Chrome&lt;/a&gt;, &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/" rel="noopener noreferrer"&gt;Firefox&lt;/a&gt;, and &lt;a href="https://microsoftedge.microsoft.com/addons/detail/axe-devtools-web-access/kcenlimkmjjkdfcaleembgmldmnnlfkn" rel="noopener noreferrer"&gt;Edge.&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Additionally, &lt;a href="https://developers.google.com/web/tools/lighthouse/" rel="noopener noreferrer"&gt;Lighthouse&lt;/a&gt; accessibility checks are powered by AXE Core as well.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftl7jufa9gkcxz6hnmv9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftl7jufa9gkcxz6hnmv9n.png" alt="Axe dev tools check results" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0hk18pw63uiail9z66p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0hk18pw63uiail9z66p.png" alt="lighthouse results" width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://wave.webaim.org/" rel="noopener noreferrer"&gt;WAVE&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;WAVE is powered by &lt;a href="https://webaim.org/" rel="noopener noreferrer"&gt;WebAim&lt;/a&gt; and functions similarly to Deque's AXE extensions.&lt;/li&gt;
&lt;li&gt;An interesting element of WAVE's functionality is that it give an accessibility markup over the entire site. 
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdirlecnq0rbvwn4lgrzb.png" alt="wave accessibility markup" width="800" height="440"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.ssa.gov/accessibility/andi/help/install.html" rel="noopener noreferrer"&gt;ANDI - Accessibility Testing Tool&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;ANDI (Accessible Name &amp;amp; Description Inspector) is a free accessibility testing tool.

&lt;ul&gt;
&lt;li&gt;ANDI allows you to inspect your page on the basis of accessible names which come in handy especially if you're working with interactive elements.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo8kpa67wkvct4b0dkc8m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo8kpa67wkvct4b0dkc8m.png" alt="focusable elements" width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Linting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://marketplace.visualstudio.com/items?itemName=deque-systems.vscode-axe-linter" rel="noopener noreferrer"&gt;VS Code AXE Accessibility Linter&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Checks React (&lt;code&gt;.js&lt;/code&gt;, .&lt;code&gt;jsx&lt;/code&gt;, &lt;code&gt;.ts&lt;/code&gt;, &lt;code&gt;.tsx&lt;/code&gt;), Vue (&lt;code&gt;.vue&lt;/code&gt;), HTML (&lt;code&gt;.html&lt;/code&gt;, &lt;code&gt;.htm&lt;/code&gt;), and Markdown (&lt;code&gt;.md&lt;/code&gt;, &lt;code&gt;.markdown&lt;/code&gt;) files so you can avoid common accessibility defects. Angular (&lt;code&gt;HTML&lt;/code&gt;) is not currently supported.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frzn1pgcqlpw2rq7fx1wg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frzn1pgcqlpw2rq7fx1wg.png" alt="targeting code that is not accessible" width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ESlint Accessibility Plugins
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;There several different plugin depending on what framework/ tech stack you're working with.

&lt;ul&gt;
&lt;li&gt;I work a lot in React so my team frequently uses this plugin:

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/eslint-plugin-jsx-a11y" rel="noopener noreferrer"&gt;eslint-plugin-jsx-a11y&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

</description>
      <category>a11y</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>design</category>
    </item>
    <item>
      <title>How to Integrate axe into your Next.js project</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Thu, 20 May 2021 17:33:23 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/integrating-axe-into-your-next-js-project-1la7</link>
      <guid>https://forem.com/stories_of_ren/integrating-axe-into-your-next-js-project-1la7</guid>
      <description>&lt;h1&gt;
  
  
  Integrating the axe wrapper in your Next.js project
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why do I even need this?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Because you're a nice person, who wants to make sure everyone is accounted for when designing and developing your projects. Also, it is plausible you may be legally obligated, depending on funding or location, you may need to comply with web accessibility standards such as &lt;a href="https://www.w3.org/TR/WCAG21/" rel="noopener noreferrer"&gt;WCAG (Web Content Accessibility Guidelines)&lt;/a&gt;. But really, there are millions of people that are affected by disabilities, so why not consider them as potential users of your software, and just start making your software accessible from the beginning.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install &lt;a href="https://www.npmjs.com/package/@axe-core/react" rel="noopener noreferrer"&gt;axe-core/react&lt;/a&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i --save-dev @axe-core/react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;em&gt;You may also need to install react-dom if it is not in your dependencies&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once your dependencies are installed, you'll need to place the wrapper within one of your Next files. It works best if you choose a file that is a wrapper itself, like the &lt;code&gt;pages/_app&lt;/code&gt; file, that way the axe wrapper will read the entire app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Determine if you are running on the Server
&lt;/h3&gt;

&lt;p&gt;Now that you have chosen the page you want to set up your axe-core wrapper, you need to write a method for checking whether you are rendering via server-side or client-side. Below is an example of how to do this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isServerSideRendered&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;undefined&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;You'll want to place this method outside of the React functional component or class setup. I put mine between my imports and the react component declaration.&lt;/p&gt;

&lt;h3&gt;
  
  
  What do you mean I need to import &lt;code&gt;React&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;Notably, we're using &lt;code&gt;Next.js&lt;/code&gt; so we don't have to import &lt;code&gt;React&lt;/code&gt;, but to set up the axe wrapper we'll need to import it into whichever file we've selected to place the wrapper.&lt;/p&gt;

&lt;p&gt;Alright, we've imported &lt;code&gt;React&lt;/code&gt; and set up our method for checking how the app is rendering. Now we can finally set up our axe wrapper.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up the Axe wrapper
&lt;/h2&gt;

&lt;p&gt;Ok, first we want to make sure this is not annoying to anyone but us, so you'll want the wrapper to conditionally render only when you're in your development environment. This is where we'll be using our &lt;code&gt;isServerSideRendered&lt;/code&gt; method in conjunction with an environment check.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;production&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isServerSideRendered&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now comes the tricky part, setting up the wrapper. For this, I'm using dynamic imports so that the modules will only load within the development environment. We don't need unused modules loitering in production.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Imports&lt;/span&gt;
&lt;span class="c1"&gt;//&lt;/span&gt;
&lt;span class="c1"&gt;// import React from 'react';&lt;/span&gt;
&lt;span class="c1"&gt;//&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isServerSideRendered&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;undefined&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;production&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isServerSideRendered&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="c1"&gt;// we import react-dom and @axe-core/react dynamically&lt;/span&gt;
    &lt;span class="c1"&gt;// so that we'll receive warning in our console about&lt;/span&gt;
    &lt;span class="c1"&gt;// inaccessible code.&lt;/span&gt;

    &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@axe-core/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;axe&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;axe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&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="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// React component Declaration&lt;/span&gt;
&lt;span class="c1"&gt;// const App =()=&amp;gt;{return&amp;lt;&amp;gt;&amp;lt;/&amp;gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// export default App;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can find an example &lt;a href="https://github.com/MileTwo/nextjs-typescript-material-ui-eslint-jest/blob/main/pages/_app.tsx" rel="noopener noreferrer"&gt;here in the next cli project&lt;/a&gt; that Mile Two is putting together for open source consumption.&lt;/p&gt;

&lt;p&gt;It will give you results that will give the severity of the issue, a code snippet of the where the issue is found, and link to an explanation in detail as to why the issue is inaccessible. &lt;/p&gt;

&lt;p&gt;And that is how you add the axe wrapper into your &lt;code&gt;Next.js&lt;/code&gt; project! Thank you for reading!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you are using VS Code, and want to make sure you are writing accessible code, you can install the &lt;a href="https://marketplace.visualstudio.com/items?itemName=deque-systems.vscode-axe-linter" rel="noopener noreferrer"&gt;axe Accessibility Linter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>nextjs</category>
      <category>react</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Taking the Axe to inaccessibility</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Fri, 11 Dec 2020 17:50:13 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/taking-the-axe-to-inaccessibility-4dkj</link>
      <guid>https://forem.com/stories_of_ren/taking-the-axe-to-inaccessibility-4dkj</guid>
      <description>&lt;h1&gt;
  
  
  Let's talk accessibility!
&lt;/h1&gt;

&lt;p&gt;When you are developing apps for everyone it's great to have some cool tools in your belt.  One of these tools is React Axe as brought you from &lt;a href="https://www.deque.com/axe/" rel="noopener noreferrer"&gt;Deque&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There are of couple ways you can use Axe.  The first being an extension for &lt;a href="https://www.deque.com/axe/devtools/" rel="noopener noreferrer"&gt;dev tools Extensions&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US" rel="noopener noreferrer"&gt;google's Developer's Tools extension&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/" rel="noopener noreferrer"&gt;Firefox Developer's Tools Add-on&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To access Axe through the extension simply open your developer's tools and click the axe tab, then you can inspect your page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwij8e45jfma6ld7fajid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwij8e45jfma6ld7fajid.png" alt="Axe in Chrome's dev tools" width="800" height="645"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another way is to wrap your app in the Axe wrapper, and you do this by first installing @axe-core/react:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i axe-core/react --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;or whatever you use to install&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;At this point, you head to the file your &lt;code&gt;ReactDom.render&lt;/code&gt; set up, this is usually the index.{js,jsx,tsx}.  &lt;/p&gt;

&lt;p&gt;Once you've made it there it is a fairly straightforward setup to get it working. &lt;/p&gt;

&lt;p&gt;First, you'll want to set it up so that the wrapper does not render in production, that would just be awkward like leaving random console.logs everywhere that say 'hi!'.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;production&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// Not For Production&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// For Production&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&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;p&gt;Now, that we have that set up we can conditionally import our module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;production&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// Not For Production&lt;/span&gt;
 &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@axe-core/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;axe&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;axe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&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="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// For Production&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&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;p&gt;We can start up our project and open up our developer's tools and go to the console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5uwu0e3tn5rq5dp8y4mx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5uwu0e3tn5rq5dp8y4mx.png" alt="react-axe wrapper outputs" width="800" height="645"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbw6zsfiac6wc7ff6itke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbw6zsfiac6wc7ff6itke.png" alt="Axe wrapper output at moderate" width="800" height="74"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These Axe wrapper outputs should help in concurrent development, as well as open up conversions with your design team to discuss color contrast issues or other conversations about accessibility.&lt;/p&gt;

</description>
      <category>react</category>
      <category>a11y</category>
      <category>inclusion</category>
      <category>beginners</category>
    </item>
    <item>
      <title>What The 'F' is Section 508: The government's response to A11y!</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Mon, 07 Dec 2020 21:26:04 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/wtf-is-section-508-the-government-s-response-to-a11y-17k7</link>
      <guid>https://forem.com/stories_of_ren/wtf-is-section-508-the-government-s-response-to-a11y-17k7</guid>
      <description>&lt;h2&gt;
  
  
  Hello! And welcome to this super basic intro to Section 508 of The Rehabilitation Act.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  So, What is Section 508?
&lt;/h2&gt;

&lt;p&gt;First, as mentioned earlier Section 508 is a part of The Rehabilitation Act of 1973.  I'm sure your thinking, 1973!!!! what that's crazy. But not really, because like most laws The Rehabilitation Act has been amended throughout the years. This section, in particular, becomes of interest in 1998. Changes were introduced that give us the updated versions of Sections 504 and 508.&lt;/p&gt;

&lt;p&gt;The act itself prohibits discrimination on the basis of disability in programs conducted by Federal agencies, in programs receiving Federal financial assistance, in Federal employment, and in the employment practices of Federal contractors.&lt;/p&gt;

&lt;p&gt;The standards for determining employment discrimination under the Rehabilitation Act are the same as those used in &lt;a href="https://www.ada.gov/cguide.htm#anchor62335" rel="noopener noreferrer"&gt;title I of the Americans with Disabilities Act&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Section 508 of the act, as now amended, provides for us a blueprint of just what is intended in Section 504. &lt;/p&gt;

&lt;p&gt;Thus, Section 504 provides the context of the law, and Section 508 provides the direction.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F39jwf2ajemx61ryrst5u.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F39jwf2ajemx61ryrst5u.gif" alt="And she said, " width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  For Context: Section 504 of the Rehabilitation Act of 1973
&lt;/h3&gt;

&lt;p&gt;504 is a Civil Rights Law&lt;br&gt;
The first legislative act to provide protection to those who have disabilities.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This applies to employers and organizations that receive federal financial assistance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The message of this section is precise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No otherwise qualified individual with a disability in the United States... shall, solely by reason of her or his disability, be excluded from participation in, be denied the benefits of, or be subjected to discrimination under any program or activity receiving Federal financial assistance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  And Now: Section 508 of the Rehabilitation Act of 1973
&lt;/h3&gt;

&lt;p&gt;The reauthorized Rehabilitation act of 1998 included amendments to &lt;a href="https://www.section508.gov/" rel="noopener noreferrer"&gt;section 508 of the act.&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This section bars the Federal Government from procuring E&amp;amp;IT (electronic and Information Technology) goods and services that are not fully accessible to those with a disability status. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This includes Web Design and creation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Architectural and Transportation Barriers compliance board was enlisted to create binding, enforceable standards.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Board enlisted the help of various accessibility advocacy groups to create the Electronic and Information Technology Access Advisory Committee or ‘EITAAC’

&lt;ul&gt;
&lt;li&gt;The committee helped create the first set of accessibility Standards and published them on December 21st, 2000.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hi! I’m Section 508, I’m kind of a big deal...
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Section 508 is extremely influential, Here are a few reasons:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;It provides the first US Federal standard for the internet.&lt;/li&gt;
&lt;li&gt;It provides compliance language that can be monitored from a distance.&lt;/li&gt;
&lt;li&gt;State governments may be held accountable for compliance.&lt;/li&gt;
&lt;li&gt;Business must comply with Section 508 when providing E&amp;amp;IT goods and services to the federal government.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Section 508 Enforcement &amp;amp; Evaluation of Conformance
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Enforcement
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The US Department of Justice of Civil Rights is charged with enforcing Section 508.&lt;/li&gt;
&lt;li&gt;When Complaints arise members of the public, students and federal employees can:

&lt;ul&gt;
&lt;li&gt;File an Administrative Complaint&lt;/li&gt;
&lt;li&gt;File a private lawsuit in federal court&lt;/li&gt;
&lt;li&gt;File a formal complaint through the US Department of Justice of Civil Rights&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Evaluation of Conformance
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The Attorney General is required to evaluate how well the government is conforming.

&lt;ul&gt;
&lt;li&gt;They are required to give an updated report on both accessibility and the Federal E&amp;amp;IT to people with disabilities and the resolution of section 508 complaints filed against federal agencies&lt;/li&gt;
&lt;li&gt;The first report was given in August 2001, the subsequent reports would be given every 2 years after.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  508 Requirements for federal departments and agencies.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhkwqoq8ycxvd51os0rxq.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhkwqoq8ycxvd51os0rxq.gif" alt="Troy walks into the room to find chaos because without rules there is chaos" width="340" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Accessibility&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Development, procurement, maintenance, or use of E&amp;amp;IT&lt;/li&gt;
&lt;li&gt;Each federal Department &amp;amp; agency (including the Post office) must ensure that individuals with disabilities can use their technology.

&lt;ul&gt;
&lt;li&gt;Exceptions: An undue burden imposed on the department or agency...&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Alternative means effort:&lt;/li&gt;

&lt;li&gt;If in the case of undue burden, the department or agency will provide information or data in an alternative means of access &lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;E&amp;amp;IT Standards&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In general&lt;/li&gt;
&lt;li&gt;No later than 18 months  the Architectural and Transportation Barriers Compliance Board (referred to in this section as the `Access Board') after consulting with various related agencies and POCs

&lt;ul&gt;
&lt;li&gt;Discussion included consultation on relative research findings and conversion with organizations that represented those with disabilities&lt;/li&gt;
&lt;li&gt;Defining the technical and functional criteria necessary to implement the requirements for this law
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Review and Amendment&lt;/li&gt;

&lt;li&gt;The access board will periodically review and amend if necessary.&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Incorporation of Standards&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No later the 6 months after the publishing of the standards the Federal Acquisition Regulatory Council will revise the Federal Acquisition Regulation and subsequently each federal department/agency will revise Federal procurement policies and directive to incorporate the standards or if revised by the access board the revisions. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Acquisition Planning&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the compliance is determined to impose an undue burden, the documentation will explain why there is an undue burden &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Exemption for National security systems&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Section 508 won’t apply to national security systems.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Construction&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Equipment&lt;/li&gt;
&lt;li&gt;Equipment is only required to be present at the location where the public is granted access to E&amp;amp;IT.&lt;/li&gt;
&lt;li&gt;The Federal department or agency isn’t required to purchase equipment except for the location where the public is granted access to E&amp;amp;IT.&lt;/li&gt;
&lt;li&gt;Software &amp;amp; peripheral devices&lt;/li&gt;
&lt;li&gt;Accessibility related software or devices are not required to be supplied to workstations of those without disabilities

&lt;ul&gt;
&lt;li&gt;Technical assistance&lt;/li&gt;
&lt;li&gt;The Admin of General Services will provide assistance concerning the requirements&lt;/li&gt;
&lt;li&gt;Agency Evaluations&lt;/li&gt;
&lt;li&gt;6 months after enactment evaluations of the state of accessibility in comparison to the usability of tech by those without disabilities will occur, a report will be submitted to the Attorney General&lt;/li&gt;
&lt;li&gt;Reports&lt;/li&gt;
&lt;li&gt;Interim

&lt;ul&gt;
&lt;li&gt;18 month after enactment&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Biennial

&lt;ul&gt;
&lt;li&gt;3 years after enactment followed by a report every 2 years thereafter.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;Corporation&lt;/li&gt;

&lt;li&gt;Each head of relative boards (this includes the Access Board) will provide information to the Attorney General to conduct evaluations &lt;/li&gt;

&lt;li&gt;Enforcement&lt;/li&gt;

&lt;li&gt;General

&lt;ul&gt;
&lt;li&gt;Complaints&lt;/li&gt;
&lt;li&gt;2 years after enactment complaints can be filed when an agency fails in the compliance&lt;/li&gt;
&lt;li&gt;Application&lt;/li&gt;
&lt;li&gt;Applies to E&amp;amp;IT procured not less than 2 years after enactment.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Administrative Complaints

&lt;ul&gt;
&lt;li&gt;Complaints filed with the Federal agency or department alleged to be non-compliant.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Civil Actions

&lt;ul&gt;
&lt;li&gt;Remedies, procedures, and rights that are set and explained in sections 505(a)(2) and 505 (b) will be the Remedies, procedures, and rights that are available to any individual with a disability filing a complaint under paragraph 1 of this section.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Application to other federal laws

&lt;ul&gt;
&lt;li&gt;Section 508 will not be construed to limit any right, remedy, or procedure otherwise available under any provision of the federal law that provides greater and equal protection for the rights of individuals with disabilities &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  THE GUIDELINES
&lt;/h2&gt;

&lt;p&gt;For Proper Legal speak, the Outline of the guidelines can be found: &lt;a href="https://www.access-board.gov/guidelines-and-standards/communications-and-it/about-the-ict-refresh/final-rule/text-of-the-standards-and-guidelines" rel="noopener noreferrer"&gt;Text of the Standards and Guidelines: Section 508.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the above site, the Access Board details the application and scoping requirements of section 508 of the Rehabilitation Act (as amended).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At the above site the Access Board details the application and scoping requirements of section 508 of the Rehabilitation Act (as amended).

&lt;ul&gt;
&lt;li&gt;The guidelines apply to:&lt;/li&gt;
&lt;li&gt;The guidelines apply to:&lt;/li&gt;
&lt;li&gt;Application&lt;/li&gt;
&lt;li&gt;General Exceptions&lt;/li&gt;
&lt;li&gt;Access to Functionality&lt;/li&gt;
&lt;li&gt;Functional Performance Criteria&lt;/li&gt;
&lt;li&gt;Electronic Content&lt;/li&gt;
&lt;li&gt;Hardware&lt;/li&gt;
&lt;li&gt;Software&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Checklists are always helpful!!
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;WebAIM: 508 Checklist&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;As of January 2018 the guidelines were updated to reflect the WCAG 2.0 guidelines following AA level success criteria.&lt;/li&gt;
&lt;li&gt;While the above site is out of date, it still gives excellent reference to the law’s checklist prior to 2018.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;HHS: Section 508 checklists&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checklists are provided in CSV/Excel format for better reporting.&lt;/li&gt;
&lt;li&gt;The accessibility checklists provide the evaluation criteria that must be met to ensure content is accessible to all users&lt;/li&gt;
&lt;li&gt;Checklists are provided for software, web applications, web sites, and various documents (Word, PowerPoint, Excel, PDF)&lt;/li&gt;
&lt;li&gt;Content was last reviewed in July of 2020&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Other Laws Related to Accessibility
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fskytc9tbmne9t11jx113.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fskytc9tbmne9t11jx113.gif" alt="The Law say, " width="500" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;USA:

&lt;ul&gt;
&lt;li&gt;ADA: Americans with Disabilities Act&lt;/li&gt;
&lt;li&gt;CVAA:21st Century Communications and &lt;/li&gt;
&lt;li&gt;Video Accessibility Act&lt;/li&gt;
&lt;li&gt;ACAA: Air Carrier Act&lt;/li&gt;
&lt;li&gt;State Web Accessibility Laws&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;International:

&lt;ul&gt;
&lt;li&gt;Canada:&lt;/li&gt;
&lt;li&gt;Web Standards for the Government of Canada&lt;/li&gt;
&lt;li&gt;AODA: Ontario: The Accessibility for &lt;/li&gt;
&lt;li&gt;Ontarians with Disabilities Act &lt;/li&gt;
&lt;li&gt;Quebec: Web accessibility standards&lt;/li&gt;
&lt;li&gt;EU: EN 301 549: "Accessibility requirements suitable for public procurement of ICT products and services in Europe"&lt;/li&gt;
&lt;li&gt;England: The Equality Act of 2010&lt;/li&gt;
&lt;li&gt;Brazilian Law for Inclusion of Persons with Disabilities&lt;/li&gt;
&lt;li&gt;Japan: The Act on the Elimination of &lt;/li&gt;
&lt;li&gt;Discrimination against Persons with Disabilities&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Ok that was heavy.
&lt;/h2&gt;

&lt;p&gt;Thank you for sticking around until this point, I put this together to help me learn about the A11y compliance law for work and wanted to share with all of you!  See you next time.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>inclusion</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to switch from Sass-lint to Stylelint</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Wed, 04 Nov 2020 13:41:02 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/switching-from-sass-lint-to-stylelint-5f8c</link>
      <guid>https://forem.com/stories_of_ren/switching-from-sass-lint-to-stylelint-5f8c</guid>
      <description>&lt;h1&gt;
  
  
  Moving from Sass-Lint to Stylelint
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Why make the transition?
&lt;/h2&gt;

&lt;p&gt;So frequently in the past, sass-lint was used as a linting staple, so why make the change from a tried and true linter to stylelint?  Well for one, Sass-Lint is no longer being maintained, but also Stylint has a wider realm of support and contributions.  stylelint has a wide variety of configs and plugins to extend, which allows you to match and go beyond the rules that are present in Sass-Lint. Not only that it also parses the syntaxes &lt;code&gt;SCSS&lt;/code&gt;, &lt;code&gt;Sass&lt;/code&gt;, &lt;code&gt;Less&lt;/code&gt;, and &lt;code&gt;SugarSS&lt;/code&gt; , while also extracting style from in-line HTML styles, markdown and CSS-in-JS objects/ template literals.  So it's great to use with a variety of frontend frameworks.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the steps?
&lt;/h2&gt;

&lt;p&gt;First, you'll want to install stylelint and any of the plug-ins and configs you plan on using. The plugins and configurations available to you are great in numbers, so you won't be left wanting. Links can be found within the stylelint repository on GitHub under a sub-directory called &lt;a href="https://github.com/stylelint/awesome-stylelint" rel="noopener noreferrer"&gt;awesome-stylelint&lt;/a&gt;. For the transition, we use &lt;code&gt;stylelint-config-recommended&lt;/code&gt;, &lt;code&gt;stylelint-config-sass-guidelines&lt;/code&gt;,  &lt;code&gt;stylelint-config-standard&lt;/code&gt;, and &lt;code&gt;stylelint-scss&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There are additional formaters within the list of plugins, but stylelint comes with inherent formatting functionality.&lt;/p&gt;

&lt;p&gt;To Install stylelint and any plug-ins/additional configs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i stylelint stylelint-config-recommended stylelint-config-sass-guidelines stylelint-config-standard stylelint-scss --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting up the rules
&lt;/h2&gt;

&lt;p&gt;Once stylint is installed, you can start putting together your &lt;code&gt;rc&lt;/code&gt; file.  You would create it with the name of &lt;code&gt;.stylelintrc.yml&lt;/code&gt;. The &lt;code&gt;rc&lt;/code&gt; file is where you'll extend and apply your plugins and configuration modules you've installed, but also where you will define and manipulate the rules that are provided in those plugins and configurations.  I like to compare my &lt;code&gt;.sass-lint.yml&lt;/code&gt; to find comparable rules.&lt;/p&gt;

&lt;p&gt;This is an example of a &lt;code&gt;.stylelintrc.yml&lt;/code&gt; file :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;defaultSeverity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;warning&lt;/span&gt;
&lt;span class="na"&gt;extends&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;stylelint-config-standard&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;stylelint-config-recommended&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;stylelint-config-sass-guidelines&lt;/span&gt;
&lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;stylelint-scss&lt;/span&gt;
&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="c1"&gt;# Line Spacing&lt;/span&gt;
&lt;span class="na"&gt;rule-empty-line-before&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;always-multi-line&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ignore&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;after-comment&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;first-nested&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;inside-block&lt;/span&gt;

&lt;span class="c1"&gt;# Disallows&lt;/span&gt;
&lt;span class="na"&gt;selector-max-id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;span class="na"&gt;comment-no-empty&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;declaration-block-no-duplicate-properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;block-no-empty&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ignore&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;comments&lt;/span&gt;
&lt;span class="na"&gt;no-descending-specificity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ignore&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;selectors-within-list&lt;/span&gt;
&lt;span class="na"&gt;no-extra-semicolons&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;color-no-invalid-hex&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;number-no-trailing-zeros&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;length-zero-no-unit&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;scss/at-extend-no-missing-placeholder&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;
&lt;span class="na"&gt;selector-no-qualifying-type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ignore&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;attribute&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;class&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;id&lt;/span&gt;
&lt;span class="na"&gt;property-no-unknown&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ignoreProperties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;box-orient'&lt;/span&gt;

&lt;span class="c1"&gt;# Nesting&lt;/span&gt;
&lt;span class="na"&gt;max-nesting-depth&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ignore&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;blockless-at-rules'&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pseudo-classes'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;  

&lt;span class="c1"&gt;# Name Formats&lt;/span&gt;
&lt;span class="na"&gt;selector-class-pattern&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;^[A-Z].*$&lt;/span&gt;
&lt;span class="na"&gt;scss/at-mixin-pattern&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;^[A-Z].*$&lt;/span&gt;  

&lt;span class="c1"&gt;# Style Guide&lt;/span&gt;
&lt;span class="na"&gt;indentation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;
&lt;span class="na"&gt;color-named&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;never'&lt;/span&gt;
&lt;span class="na"&gt;declaration-block-trailing-semicolon&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
&lt;span class="na"&gt;unit-case&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lower&lt;/span&gt;
&lt;span class="na"&gt;color-hex-case&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lower&lt;/span&gt;
&lt;span class="na"&gt;number-leading-zero&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
&lt;span class="na"&gt;unit-no-unknown&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ignoreUnits&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;/^[-+][\d$(]/&lt;/span&gt;
&lt;span class="na"&gt;font-family-no-duplicate-names&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;string-quotes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;single&lt;/span&gt;
&lt;span class="na"&gt;selector-max-compound-selectors&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;

&lt;span class="c1"&gt;# Inner Spacing&lt;/span&gt;
&lt;span class="na"&gt;function-calc-no-unspaced-operator&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;declaration-block-semicolon-newline-after&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
&lt;span class="na"&gt;block-opening-brace-space-before&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
&lt;span class="na"&gt;block-opening-brace-newline-after&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
&lt;span class="na"&gt;block-closing-brace-newline-after&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
&lt;span class="na"&gt;declaration-bang-space-after&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;never&lt;/span&gt;
&lt;span class="na"&gt;declaration-colon-space-after&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;

&lt;span class="c1"&gt;# Final Items&lt;/span&gt;
&lt;span class="na"&gt;scss/at-import-partial-extension-blacklist&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;/css/&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;These files are super flexible and not set in stone, they are made to be updated per a project's needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding the scripts
&lt;/h2&gt;

&lt;p&gt;Stylelint uses &lt;code&gt;npx&lt;/code&gt; to run inherently, so when you write your scripts in your package.json you need to add the &lt;code&gt;npx&lt;/code&gt; in for it to work properly.  Below are the base scripts for running the linter and formatting based on your rules.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"stylelint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"stylelint '**/*.scss'"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"stylelint-fix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"stylelint '**/*.scss' --fix"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ok the rules are set up you have your scripts, so running the scripts to make sure they work is key.  Now, running the &lt;code&gt;stylelint-fix&lt;/code&gt; will not fix everything magically.  Likely, you will still need to go through and make some changes before your transition is complete.  &lt;/p&gt;

&lt;p&gt;At this point, you can add your &lt;code&gt;npm run stylelint&lt;/code&gt; and &lt;code&gt;npm run stylelint-fix&lt;/code&gt; to your &lt;code&gt;lint&lt;/code&gt; and &lt;code&gt;format&lt;/code&gt; script replacing whatever you had there for sass-lint.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Time to remove Sass-lint
&lt;/h2&gt;

&lt;p&gt;Since we replaced the sass-lint scripts in the &lt;code&gt;lint&lt;/code&gt; and &lt;code&gt;format&lt;/code&gt; scripts we can uninstall sass-lint.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm unistall sass-lint sass-lint-auto-fix&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you can delete your &lt;code&gt;sass-lint.yml&lt;/code&gt; file, after that is done I like to do a fresh install by running:&lt;br&gt;
 &lt;code&gt;rm -rf node_modules/ package-lock.json&lt;/code&gt; &lt;br&gt;
 then&lt;br&gt;
 &lt;code&gt;npm i&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get to fixing
&lt;/h2&gt;

&lt;p&gt;From here you are free to run your lint and formats.  Your new rule definitions will likely introduce new warnings for you.  So you can run the formatter to see how far that gets you, but inevitably you will need to fix some &lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://stylelint.io/" rel="noopener noreferrer"&gt;Stylelint&lt;/a&gt; &lt;br&gt;
&lt;a href="https://github.com/sasstools/sass-lint" rel="noopener noreferrer"&gt;Sass Lint&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Pour Explained: R is for Robust</title>
      <dc:creator>⚡️Ren⚡️</dc:creator>
      <pubDate>Fri, 09 Oct 2020 19:22:29 +0000</pubDate>
      <link>https://forem.com/stories_of_ren/pour-explained-r-is-for-robust-3ee6</link>
      <guid>https://forem.com/stories_of_ren/pour-explained-r-is-for-robust-3ee6</guid>
      <description>&lt;h2&gt;
  
  
  &lt;a href="https://www.w3.org/TR/WCAG21/#robust" rel="noopener noreferrer"&gt;&lt;strong&gt;Principle 4 -- Robust&lt;/strong&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Content &lt;strong&gt;MUST&lt;/strong&gt; be robust so that a variety of user agents and devices can interpret it.  This includes assistive tech.
&lt;/h3&gt;

&lt;p&gt;Again, a quick refresher on the levels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A, AA, AAA&lt;/li&gt;
&lt;li&gt;Many entities try to maintain a level AA compliance because it is achievable as well as meaningful. Maintaining just a level AA compliance is still falling short in being accessible and inclusive.&lt;/li&gt;
&lt;li&gt;Every guideline success criterion is necessary to at least some users with disabilities, so don't ignore level AAA compliance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Guidelines:&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;a href="https://www.w3.org/TR/WCAG21/#compatible" rel="noopener noreferrer"&gt;4.1 Compatible&lt;/a&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Compatability must be at the forefront of planning so that current and future user agents will be compatible.  This includes assistive tech.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Success Criteria:&lt;/strong&gt;
&lt;/h3&gt;

&lt;h5&gt;
  
  
  4.1.1 Parsing
&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;Level A&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Following these standards:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Content must be implemented in markup languages&lt;/li&gt;
&lt;li&gt;Elements must have complete start and end tags.&lt;/li&gt;
&lt;li&gt;Element must be nested to their specifications&lt;/li&gt;
&lt;li&gt;Elements don't include duplicated attributes&lt;/li&gt;
&lt;li&gt;Id's assigned to elements must be unique&lt;/li&gt;
&lt;li&gt;Exception:

&lt;ul&gt;
&lt;li&gt;Only where specs allow &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h5&gt;
  
  
  4.1.2 Name, Role, Value
&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;Level A&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For all UI components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name &amp;amp; Role programmatically determined&lt;/li&gt;
&lt;li&gt;States, Properties, and Values that can be set by users can be programmatically set.&lt;/li&gt;
&lt;li&gt;Changes allow for notifications to the user agents.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This particular success criterion is primarily for web authors, who build custom controls&lt;/em&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  4.1.3 Status Messages
&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;Level AA&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Content that is implemented by using markup languages, a status message, or messages can be programmatically determined through role or props such that they can be present to the user through assistive tech without receiving focus.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpnltazyh3cq3db30bvs4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpnltazyh3cq3db30bvs4.gif" alt="OMG" width="500" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Oh... My... Glob! We've made it! We have covered the POUR Principles of the WCAG 2.0 &amp;amp; 2.1 Guidelines.  That is so exciting!  I'm hoping that this is just the beginning of your journey into exploring accessibility and wish you the best as you continue to study to make software and the web a better place for all.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>inclusion</category>
    </item>
  </channel>
</rss>
