Skip to content

Commit c187f77

Browse files
committedDec 14, 2014
Merge pull request twbs#15363 from patrickhlauke/docs-nicer-skip-link
Make skip link look less "bare bones"
2 parents f11a3a3 + 2d41894 commit c187f77

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed
 

‎docs/_includes/getting-started/accessibility.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ <h1 id="accessibility" class="page-header">Accessibility</h1>
33
<p class="lead">Bootstrap follows common web standards and&mdash;with minimal extra effort&mdash;can be used to create sites that are accessible to those using <abbr title="Assistive Technology" class="initialism">AT</abbr>.</p>
44

55
<h3>Skip navigation</h3>
6-
<p>If your navigation contains many links and comes before the main content in the DOM, add a <code>Skip to main content</code> link immediately after your opening <code>&lt;body&gt;</code> tag. <a href="http://a11yproject.com/posts/skip-nav-links/">(read why)</a></p>
6+
<p>If your navigation contains many links and comes before the main content in the DOM, add a <code>Skip to main content</code> link before the navigation <a href="http://a11yproject.com/posts/skip-nav-links/">(read why)</a>. Using the <code>.sr-only</code> class will visually hide the skip link, and the <code>.sr-only-focusable</code> class will ensure that the link becomes visible once focused (for sighted keyboard users).</p>
77
{% highlight html %}
88
<body>
99
<a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
10+
...
1011
<div class="container" id="content">
11-
The main page content.
12+
<!-- The main page content -->
1213
</div>
1314
</body>
1415
{% endhighlight %}

‎docs/_layouts/default.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% include header.html %}
66
</head>
77
<body>
8-
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
8+
<a id="skippy" class="sr-only sr-only-focusable" href="#content"><div class="container"><span class="skiplink-text">Skip to main content</span></div></a>
99

1010
<!-- Docs master nav -->
1111
{% include nav/main.html %}

‎docs/_layouts/home.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% include header.html %}
66
</head>
77
<body class="bs-docs-home">
8-
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
8+
<a id="skippy" class="sr-only sr-only-focusable" href="#content"><div class="container"><span class="skiplink-text">Skip to main content</span></div></a>
99

1010
<!-- Docs master nav -->
1111
{% include nav/main.html %}

‎docs/assets/css/src/docs.css

+20
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,26 @@ body {
8989
}
9090

9191

92+
/*
93+
* Fancy skip link
94+
*
95+
* Make it look a bit less "bare bones"
96+
*/
97+
98+
#skippy {
99+
display: block;
100+
padding: 1em;
101+
color: #fff;
102+
background-color: #6F5499;
103+
outline: 0;
104+
}
105+
106+
#skippy .skiplink-text {
107+
padding: 0.5em;
108+
outline: 1px dotted;
109+
}
110+
111+
92112
/*
93113
* Main navigation
94114
*

0 commit comments

Comments
 (0)
Please sign in to comment.