Skip to content

Commit 9138363

Browse files
svetoldo4444kavalorkin
authored andcommitted
docs(getting-started): add accessibility description section to Getting started page (#3944)
* docs(getting-started): add accessibility decscription section to Getting started page * add accessibility description sections
1 parent 0b1d8e7 commit 9138363

File tree

21 files changed

+122
-5
lines changed

21 files changed

+122
-5
lines changed

demo/src/app/common/getting-started/getting-started.component.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ <h2>Table of contents</h2>
5656
<li><a routerLink="." fragment="api">API</a></li>
5757
<li><a routerLink="." fragment="troubleshooting">Troubleshooting</a></li>
5858
<li><a routerLink="." fragment="contribution">Contributing</a></li>
59+
<li><a routerLink="." fragment="accessibility">Accessibility</a></li>
5960
<!--<li><a routerLink="." fragment="license">License</a></li>-->
6061
</ol>
6162

@@ -127,6 +128,37 @@ <h3>Credits</h3>
127128
<a href="https://www.browserstack.com">Browser Stack</a>
128129
<a href="https://www.browserstack.com"><img src="https://camo.githubusercontent.com/a7b268f2785656ab3ca7b1cbb1633ee5affceb8f/68747470733a2f2f64677a6f7139623561736a67312e636c6f756466726f6e742e6e65742f70726f64756374696f6e2f696d616765732f6c61796f75742f6c6f676f2d6865616465722e706e67" alt="Browser Stack" height="31px"></a>
129130
</p>
131+
132+
<h2 id="accessibility">Accessibility</h2>
133+
134+
<h3>Overview and Limitations</h3>
135+
136+
<p>The overall accessibility of any project built with ngx-bootstrap depends in large part on the author’s markup, additional styling, and scripting they’ve included.
137+
However, provided that these have been implemented correctly, it should be perfectly possible to create websites and applications
138+
that fulfill <a href="https://www.w3.org/TR/WCAG20/"><abbr title="Web Content Accessibility Guidelines">WCAG</abbr> 2.0</a> (A/AA/AAA),
139+
<a href="https://www.section508.gov/">Section 508</a> and similar accessibility standards and requirements.</p>
140+
141+
<h3>Interactive components</h3>
142+
143+
<p>Interactive components—such as modal dialogs, dropdown menus and custom tooltips—are designed to work for touch, mouse and keyboard users.
144+
Through the use of relevant <a href="https://www.w3.org/WAI/intro/aria"><abbr title="Web Accessibility Initiative">WAI</abbr>-<abbr title="Accessible Rich Internet Applications">ARIA</abbr></a>
145+
roles and attributes, these components should also be understandable and operable using assistive technologies (such as screen readers).</p>
146+
<p>Authors need to include ARIA roles and attributes to more accurately convey the precise nature of their component. </p>
147+
148+
<h3>Color contrast</h3>
149+
150+
<p>Most colors that currently make up Bootstrap’s default palette—used throughout the framework for things such as button variations, alert variations, form validation indicators—lead to <em>insufficient</em> color contrast (below the recommended <a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html">WCAG 2.0 color contrast ratio of 4.5:1</a>) when used against a light background. Authors will need to manually modify/extend these default colors to ensure adequate color contrast ratios.</p>
151+
152+
<h3>Additional resources</h3>
153+
154+
<ul>
155+
<li><a href="https://www.w3.org/TR/WCAG20/">Web Content Accessibility Guidelines (WCAG) 2.0</a></li>
156+
<li><a href="http://a11yproject.com/">The A11Y Project</a></li>
157+
<li><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility">MDN accessibility documentation</a></li>
158+
<li><a href="https://tenon.io/">Tenon.io Accessibility Checker</a></li>
159+
<li><a href="https://developer.paciellogroup.com/resources/contrastanalyser/">Colour Contrast Analyser (CCA)</a></li>
160+
<li><a href="https://github.com/squizlabs/HTML_CodeSniffer">“HTML Codesniffer” bookmarklet for identifying accessibility issues</a></li>
161+
</ul>
130162
</div>
131163
</div>
132164
</demo-section>

demo/src/app/components/+carousel/carousel-section.list.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { DemoCarouselIntervalComponent } from './demos/interval/interval';
88
import { DemoCarouselDisableIndicatorComponent } from './demos/disable-indicator/disable-indicator';
99
import { DemoCarouselDisableLoopingComponent } from './demos/disable-looping/disable-looping';
1010
import { DemoCarouselSlideChangedEventComponent } from './demos/slide-changed-event/slide-changed-event';
11+
import { DemoAccessibilityComponent } from './demos/accessibility/accessibility';
1112

1213
import { ContentSection } from '../../docs/models/content-section.model';
1314
import { DemoTopSectionComponent } from '../../docs/demo-section-components/demo-top-section/index';
@@ -103,6 +104,11 @@ export const demoComponentContent: ContentSection[] = [
103104
component: require('!!raw-loader?lang=typescript!./demos/slide-changed-event/slide-changed-event.ts'),
104105
html: require('!!raw-loader?lang=markup!./demos/slide-changed-event/slide-changed-event.html'),
105106
outlet: DemoCarouselSlideChangedEventComponent
107+
},
108+
{
109+
title: 'Accessibility',
110+
anchor: 'accessibility',
111+
outlet: DemoAccessibilityComponent
106112
}
107113
]
108114
},
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>The <code>alt</code> attribute is meant to help users not miss any content, so make sure your text is helpful to anyone not seeing the image. </p>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'demo-accessibility',
5+
templateUrl: './accessibility.html'
6+
})
7+
export class DemoAccessibilityComponent {}

demo/src/app/components/+carousel/demos/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { DemoCarouselIntervalComponent } from './interval/interval';
88
import { DemoCarouselDisableIndicatorComponent } from './disable-indicator/disable-indicator';
99
import { DemoCarouselDisableLoopingComponent } from './disable-looping/disable-looping';
1010
import { DemoCarouselSlideChangedEventComponent } from './slide-changed-event/slide-changed-event';
11+
import { DemoAccessibilityComponent } from './accessibility/accessibility';
1112

1213
export const DEMO_COMPONENTS = [
1314
DemoCarouselDynamicComponent,
@@ -20,5 +21,6 @@ export const DEMO_COMPONENTS = [
2021
DemoCarouselIntervalComponent,
2122
DemoCarouselDisableIndicatorComponent,
2223
DemoCarouselDisableLoopingComponent,
23-
DemoCarouselSlideChangedEventComponent
24+
DemoCarouselSlideChangedEventComponent,
25+
DemoAccessibilityComponent
2426
];

demo/src/app/components/+collapse/collapse-section.list.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ContentSection } from '../../docs/models/content-section.model';
55
import { DemoTopSectionComponent } from '../../docs/demo-section-components/demo-top-section/index';
66
import { ExamplesComponent } from '../../docs/demo-section-components/demo-examples-section/index';
77
import { ApiSectionsComponent } from '../../docs/demo-section-components/demo-api-section/index';
8+
import { DemoAccessibilityComponent } from './demos/accessibility/accessibility';
89

910
import { NgApiDocComponent } from '../../docs/api-docs';
1011

@@ -35,6 +36,11 @@ export const demoComponentContent: ContentSection[] = [
3536
component: require('!!raw-loader?lang=typescript!./demos/toggle-manual/toggle-manual'),
3637
html: require('!!raw-loader?lang=markup!./demos/toggle-manual/toggle-manual.html'),
3738
outlet: ToggleManualDemoComponent
39+
},
40+
{
41+
title: 'Accessibility',
42+
anchor: 'accessibility',
43+
outlet: DemoAccessibilityComponent
3844
}
3945
]
4046
},
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>Be sure to add <code class="highlighter-rouge">aria-expanded</code> to the control element. This attribute explicitly conveys the current state of the collapsible element tied to the control to screen readers and similar assistive technologies. If the collapsible element is closed by default, the attribute on the control element should have a value of <code class="highlighter-rouge">aria-expanded="false"</code>. If you’ve set the collapsible element to be open by default using the <code class="highlighter-rouge">show</code> class, set <code class="highlighter-rouge">aria-expanded="true"</code> on the control instead. The plugin will automatically toggle this attribute on the control based on whether or not the collapsible element has been opened or closed. If the control element’s HTML element is not a button (e.g., an <code class="highlighter-rouge">&lt;a&gt;</code> or <code class="highlighter-rouge">&lt;div&gt;</code>), the attribute <code class="highlighter-rouge">role="button"</code> should be added to the element.</p>
2+
<p>If your control element is targeting a single collapsible element – i.e. the <code class="highlighter-rouge">data-target</code> attribute is pointing to an <code class="highlighter-rouge">id</code> selector – you should add the <code class="highlighter-rouge">aria-controls</code> attribute to the control element, containing the <code class="highlighter-rouge">id</code> of the collapsible element. Modern screen readers and similar assistive technologies make use of this attribute to provide users with additional shortcuts to navigate directly to the collapsible element itself.</p>
3+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'demo-accessibility',
5+
templateUrl: './accessibility.html'
6+
})
7+
export class DemoAccessibilityComponent {}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { CollapseDemoComponent } from './basic/basic';
22
import { ToggleManualDemoComponent } from './toggle-manual/toggle-manual';
3+
import { DemoAccessibilityComponent } from './accessibility/accessibility';
34

45
export const DEMO_COMPONENTS = [
56
CollapseDemoComponent,
6-
ToggleManualDemoComponent
7+
ToggleManualDemoComponent,
8+
DemoAccessibilityComponent
79
];
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<p>The <a href="https://www.w3.org/TR/wai-aria/"><abbr title="Web Accessibility Initiative">WAI</abbr> <abbr title="Accessible Rich Internet Applications">ARIA</abbr></a> standard defines an actual <a href="https://www.w3.org/TR/wai-aria-1.1/#menu"><code class="highlighter-rouge">role="menu"</code> widget</a>, but this is specific to application-like menus which trigger actions or functions. <abbr title="Accessible Rich Internet Applications">ARIA</abbr> menus can only contain menu items, checkbox menu items, radio button menu items, radio button groups, and sub-menus.</p>
2+
<p>Dropdowns, on the other hand, are designed to be generic and applicable to a variety of situations and markup structures. For instance, it is possible to create dropdowns that contain additional inputs and form controls, such as search fields or login forms. For this reason, ngx-bootstrap does not expect (nor automatically add) any of the <code class="highlighter-rouge">role</code> and <code class="highlighter-rouge">aria-</code> attributes required for true <abbr title="Accessible Rich Internet Applications">ARIA</abbr> menus. Authors will have to include these more specific attributes themselves.</p>

0 commit comments

Comments
 (0)