Text cosmetics
parent
8309633198
commit
3456b5bd35
|
@ -1,9 +1,8 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>Colors on a web page should aim a contrast ratio of at least <strong>4.5:1</strong> and consider a selection of colors that do not cause vibration.</p>
|
||||
</DocSectionText>
|
||||
<h3>Good Contrast</h3>
|
||||
<p class="doc-section-description">Color contrast between the background and the foreground content should be sufficient enough to ensure readability. Example below displays two cases with good and bad samples.</p>
|
||||
<p>Color contrast between the background and the foreground content should be sufficient enough to ensure readability. Example below displays two cases with good and bad samples.</p>
|
||||
|
||||
<div class="flex">
|
||||
<div class="h-8rem w-8rem flex justify-content-center align-items-center mr-5 font-bold bg-blue-600" style="borderradius: 10px">
|
||||
|
@ -15,7 +14,7 @@
|
|||
</div>
|
||||
|
||||
<h3>Vibration</h3>
|
||||
<p class="doc-section-description">Color vibration is leads to an illusion of motion due to choosing colors that have low visibility against each other. Color combinations need to be picked with caution to avoid vibration.</p>
|
||||
<p>Color vibration is leads to an illusion of motion due to choosing colors that have low visibility against each other. Color combinations need to be picked with caution to avoid vibration.</p>
|
||||
|
||||
<div class="flex">
|
||||
<div class="h-8rem w-8rem flex justify-content-center align-items-center mr-5 font-bold bg-pink-500" style="borderradius: 10px">
|
||||
|
@ -24,7 +23,7 @@
|
|||
</div>
|
||||
|
||||
<h3>Dark Mode</h3>
|
||||
<p class="doc-section-description">Highly saturated colors should be avoided when used within a dark design scheme as they cause eye strain. Instead desaturated colors should be preferred.</p>
|
||||
<p>Highly saturated colors should be avoided when used within a dark design scheme as they cause eye strain. Instead desaturated colors should be preferred.</p>
|
||||
|
||||
<div class="flex">
|
||||
<div class="h-8rem w-8rem flex flex-column justify-content-center align-items-center mr-5 font-bold bg-gray-900" style="borderradius: 10px">
|
||||
|
@ -36,4 +35,5 @@
|
|||
<i class="text-indigo-200 pi pi-check-circle mt-3 text-xl"></i>
|
||||
</div>
|
||||
</div>
|
||||
</DocSectionText>
|
||||
</template>
|
||||
|
|
|
@ -10,22 +10,28 @@
|
|||
|
||||
</code></pre>
|
||||
|
||||
<p class="doc-section-description">On the other hand, a fancy css based button using a div has no keyboard or screen reader support.</p>
|
||||
<div class="doc-section-description">
|
||||
<p>On the other hand, a fancy css based button using a div has no keyboard or screen reader support.</p>
|
||||
</div>
|
||||
<pre v-code.script><code>
|
||||
<div class="fancy-button" @click="onButtonClick(event)">Click</div>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p class="doc-section-description">
|
||||
<i>tabindex</i> is required to make a div element accessible in addition to use a keydown to bring the keyboard support back. To avoid the overload and implementing functionality that is already provided by the browser, native form controls
|
||||
should be preferred.
|
||||
<div class="doc-section-description">
|
||||
<p>
|
||||
<i>tabindex</i> is required to make a div element accessible in addition to use a keydown to bring the keyboard support back. To avoid the overload and implementing functionality that is already provided by the browser, native form
|
||||
controls should be preferred.
|
||||
</p>
|
||||
</div>
|
||||
<pre v-code.script><code>
|
||||
<div class="fancy-button" @click="onClick(event)" @keydown="onKeyDown(event)" tabindex="0">Click</div>
|
||||
|
||||
</code></pre>
|
||||
|
||||
<p class="doc-section-description">Form components must be related to another element that describes what the form element is used for. This is usually achieved with the <i>label</i> element.</p>
|
||||
<div class="doc-section-description">
|
||||
<p>Form components must be related to another element that describes what the form element is used for. This is usually achieved with the <i>label</i> element.</p>
|
||||
</div>
|
||||
<pre v-code.script><code>
|
||||
<label for="myinput">Username:</label>
|
||||
<input id="myinput" type="text" name="username" />
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
<template>
|
||||
<p class="line-height-3 bg-indigo-600 text-white p-3 text-lg" style="border-radius: 10px">PrimeVue has WCAG 2.1 AA level compliancy. Refer to the accessibility documentation of each component for detailed information.</p>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>
|
||||
According to the World Health Organization, 15% of the world population has a disability to some degree. As a result, accessibility features in any context such as a ramp for wheelchair users or a multimedia with captions are crucial to
|
||||
ensure content can be consumed by anyone.
|
||||
</p>
|
||||
<p>Types of disabilities are diverse so you need to know your audience well and how they interact with the content created. There four main categories;</p>
|
||||
</DocSectionText>
|
||||
|
||||
<h3>Visual Impairments</h3>
|
||||
<p class="doc-section-description">
|
||||
Blindness, low-level vision or color blindness are the common types of visual impairments. Screen magnifiers and the color blind mode are usually built-in features of the browsers whereas for people who rely on screen readers, page developers
|
||||
are required to make sure content is readable by the readers. Popular readers are
|
||||
<p>
|
||||
Blindness, low-level vision or color blindness are the common types of visual impairments. Screen magnifiers and the color blind mode are usually built-in features of the browsers whereas for people who rely on screen readers, page
|
||||
developers are required to make sure content is readable by the readers. Popular readers are
|
||||
<a href="https://www.nvaccess.org" alt="NVDA Reader"> NVDA </a>
|
||||
,
|
||||
<a href="https://www.freedomscientific.com/Products/software/JAWS/" alt="JAWS Reader"> JAWS </a> and
|
||||
|
@ -20,20 +18,21 @@
|
|||
</p>
|
||||
|
||||
<h3>Hearing Impairments</h3>
|
||||
<p class="doc-section-description">
|
||||
<p>
|
||||
Deafness or hearing loss refers to the inability to hear sounds totally or partially. People with hearing impairments use assistive devices however it may not be enough when interacting with a web page. Common implementation is providing
|
||||
textual alternatives, transcripts and captions for content with audio.
|
||||
</p>
|
||||
|
||||
<h3>Mobility Impairments</h3>
|
||||
<p class="doc-section-description">
|
||||
People with mobility impairments have disabilities related to movement due to loss of a limb, paralysis or other varying reasons. Assistive technologies like a head pointer is a device to interact with a screen whereas keyboard or a trackpad
|
||||
remain as solutions for people who are not able to utilize a mouse.
|
||||
<p>
|
||||
People with mobility impairments have disabilities related to movement due to loss of a limb, paralysis or other varying reasons. Assistive technologies like a head pointer is a device to interact with a screen whereas keyboard or a
|
||||
trackpad remain as solutions for people who are not able to utilize a mouse.
|
||||
</p>
|
||||
|
||||
<h3>Cognitive Impairments</h3>
|
||||
<p class="doc-section-description">
|
||||
<p>
|
||||
Cognitive impairments have a wider range that includes people with learning disabilities, depression and dyslexia. A well designed content also leads to better user experience for people without disabilities so designing for cognitive
|
||||
impairments result in better design for any user.
|
||||
</p>
|
||||
</DocSectionText>
|
||||
</template>
|
||||
|
|
|
@ -26,7 +26,9 @@
|
|||
|
||||
</code></pre>
|
||||
|
||||
<p class="doc-section-description">Same layout can be achieved using the semantic elements with screen reader support built-in.</p>
|
||||
<div class="doc-section-description">
|
||||
<p>Same layout can be achieved using the semantic elements with screen reader support built-in.</p>
|
||||
</div>
|
||||
<pre v-code.script><code>
|
||||
<header>
|
||||
<h1>Header</h1>
|
||||
|
|
|
@ -18,10 +18,12 @@
|
|||
|
||||
</code></pre>
|
||||
|
||||
<p class="doc-section-description">
|
||||
A fancy checkbox with css animations might look more appealing but accessibility might be lacking. Checkbox below may display a checked font icon with animations however it is not tabbable, cannot be checked with space key and cannot be read
|
||||
by a reader.
|
||||
<div class="doc-section-description">
|
||||
<p>
|
||||
A fancy checkbox with css animations might look more appealing but accessibility might be lacking. Checkbox below may display a checked font icon with animations however it is not tabbable, cannot be checked with space key and cannot be
|
||||
read by a reader.
|
||||
</p>
|
||||
</div>
|
||||
<pre v-code.script><code>
|
||||
<div class="fancy-checkbox">
|
||||
<i class="checked-icon" v-if="checked"></i>
|
||||
|
@ -29,7 +31,9 @@
|
|||
|
||||
</code></pre>
|
||||
|
||||
<p class="doc-section-description">One alternative is using ARIA roles for readers and use javascript for keyboard support. Notice the usage of <i>aria-labelledby</i> as a replacement of the <i>label</i> tag with for.</p>
|
||||
<div class="doc-section-description">
|
||||
<p>One alternative is using ARIA roles for readers and use javascript for keyboard support. Notice the usage of <i>aria-labelledby</i> as a replacement of the <i>label</i> tag with for.</p>
|
||||
</div>
|
||||
<pre v-code.script><code>
|
||||
<span id="chk-label">Remember Me</span>
|
||||
<div class="fancy-checkbox" role="checkbox" aria-checked="false" tabindex="0" aria-labelledby="chk-label"
|
||||
|
@ -39,11 +43,13 @@
|
|||
|
||||
</code></pre>
|
||||
|
||||
<p class="doc-section-description">
|
||||
<div class="doc-section-description">
|
||||
<p>
|
||||
However the best practice is combining semantic HTML for accessibility while keeping the design for UX. This approach involves hiding a native checkbox for accessibility and using javascript events to update its state. Notice the usage of
|
||||
<i>p-sr-only</i>
|
||||
that hides the elements from the user but not from the screen reader.
|
||||
</p>
|
||||
</div>
|
||||
<pre v-code.script><code>
|
||||
<label for="chkbox">Remember Me</label>
|
||||
<div class="fancy-checkbox" @click="toggle">
|
||||
|
@ -54,7 +60,9 @@
|
|||
|
||||
</code></pre>
|
||||
|
||||
<p class="doc-section-description">A working sample is the PrimeVue checkbox that is tabbable, keyboard accessible and is compliant with a screen reader. Instead of ARIA roles it relies on a hidden native checkbox.</p>
|
||||
<div class="doc-section-description">
|
||||
<p>A working sample is the PrimeVue checkbox that is tabbable, keyboard accessible and is compliant with a screen reader. Instead of ARIA roles it relies on a hidden native checkbox.</p>
|
||||
</div>
|
||||
|
||||
<div class="card flex align-items-center justify-content-center">
|
||||
<label for="binary" class="mr-2">Remember Me</label>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
refers to <strong>Web Content Accessibility Guideline</strong>, a standard managed by the WAI (Web Accessibility Initiative) of W3C (World Wide Web Consortium). WCAG consists of recommendations for making the web content more accessible.
|
||||
PrimeVue components aim high level of WCAG compliancy in the near future.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Various countries around the globe have governmental policies regarding web accessibility as well. Most well known of these are <a href="https://www.section508.gov/manage/laws-and-policies/">Section 508</a> in the US and
|
||||
<a href="https://digital-strategy.ec.europa.eu/en/policies/web-accessibility">Web Accessibility Directive</a> of the European Union.
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<div class="doc-intro">
|
||||
<h1>Accessibility</h1>
|
||||
<p>An introduction to accessibility and how it translates to Vue UI Components.</p>
|
||||
<p class="line-height-3 bg-indigo-600 text-white p-3 text-lg" style="border-radius: 10px">PrimeVue has WCAG 2.1 AA level compliancy. Refer to the accessibility documentation of each component for detailed information.</p>
|
||||
</div>
|
||||
<DocSections :docs="docs" />
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue