Skip to content

Commit

Permalink
Make Breadcrumb Example Link Separators With CSS Boarders
Browse files Browse the repository at this point in the history
Per discussion in issue #187, the visual separators between breadcrumb links are only for visual presentation and create unnecessary verbosity if they are announced by screen readers. This change displays them with CSS boarders so they are not announced.

This commit also includes revisions to the accessibility features section of the breadcrumb example page to describe this feature.
  • Loading branch information
Michiel Bijl authored and mcking65 committed Feb 14, 2017
1 parent d84d9a2 commit 1cd36b7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
16 changes: 13 additions & 3 deletions examples/breadcrumb/css/breadcrumb.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@ nav.breadcrumb li {
display: inline;
}

/*nav.breadcrumb li + li::before {
display: inline-block;
content: url('../images/slash.svg');
vertical-align: middle;
}*/

nav.breadcrumb li + li::before {
color: #333;
content: '/\00a0';
display: inline-block;
margin: 0 .25em;
transform: rotate(15deg);
border-right: .1em solid currentColor;
height: .8em;
content: '';
}

nav.breadcrumb a {
Expand All @@ -35,4 +45,4 @@ nav.breadcrumb [aria-current="page"] {
color: #000;
font-weight: 700;
text-decoration: none;
}
}
12 changes: 10 additions & 2 deletions examples/breadcrumb/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,16 @@ <h2 id="ex_label">Example</h2>
<h2>Accessibility Features</h2>
<ul>
<li>The set of links is structured using an ordered list .</li>
<li>The visual separators between links are added through <abbr title="Cascading Style Sheets">CSS</abbr> so they do not add unnecessary screen reader verbosity.</li>
<li>A labelled <code>nav</code> element identifies the structure and makes it easy to identify and locate.</li>
<li>A <code>nav</code> element labeled <q>Breadcrumb</q> identifies the structure as a breadcrumb trail and makes it a navigation landmark so that it is easy to locate.</li>
<li>To prevent screen reader announcement of the visual separators between links, they are added via <abbr title="Cascading Style Sheets">CSS</abbr>:
<ul>
<li>
The separators are part of the visual presentation that signifies the breadcrumb trail, which is already semantically represented by the <code>nav</code> element with its label of <q>Breadcrumb</q>.
So, using a display technique that is not represented in the accessibility tree used by screen readers prevents redundant and potentially distracting verbosity.
</li>
<li>Each link has a border on one side that is skewed with the CSS’ <code>transform</code> property so it resembles a slash.</li>
</ul>
</li>
</ul>
</section>

Expand Down

0 comments on commit 1cd36b7

Please sign in to comment.