mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Merge pull request #15320 from patrickhlauke/docs-accessibility-tweaks
Docs accessibility tweaks: use ``aria-label`` for close ``<button>``, expand advice for ``<abbr>``, form control labels, make sidebar navigation a ``<nav>``
This commit is contained in:
commit
255e5d6875
@ -40,13 +40,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="bs-example" data-example-id="dismissible-alert-css">
|
<div class="bs-example" data-example-id="dismissible-alert-css">
|
||||||
<div class="alert alert-warning alert-dismissible" role="alert">
|
<div class="alert alert-warning alert-dismissible" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<strong>Warning!</strong> Better check yourself, you're not looking too good.
|
<strong>Warning!</strong> Better check yourself, you're not looking too good.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<div class="alert alert-warning alert-dismissible" role="alert">
|
<div class="alert alert-warning alert-dismissible" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<strong>Warning!</strong> Better check yourself, you're not looking too good.
|
<strong>Warning!</strong> Better check yourself, you're not looking too good.
|
||||||
</div>
|
</div>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
@ -208,7 +208,7 @@
|
|||||||
|
|
||||||
<div class="bs-callout bs-callout-warning" id="callout-navbar-form-labels">
|
<div class="bs-callout bs-callout-warning" id="callout-navbar-form-labels">
|
||||||
<h4>Always add labels</h4>
|
<h4>Always add labels</h4>
|
||||||
<p>Screen readers will have trouble with your forms if you don't include a label for every input. For these inline navbar forms, you can hide the labels using the <code>.sr-only</code> class.</p>
|
<p>Screen readers will have trouble with your forms if you don't include a label for every input. For these inline forms, you can hide the labels using the <code>.sr-only</code> class. There are further alternative methods of providing a label for assistive technologies, such as the <code>aria-label</code>, <code>aria-labelledby</code> or <code>title</code> attribute. If none of these is present, screen readers may resort to using the <code>placeholder</code> attribute, if present, but note that use of <code>placeholder</code> as a replacement for other labelling methods is not advised.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,10 +56,10 @@
|
|||||||
<h3 id="helper-classes-close">Close icon</h3>
|
<h3 id="helper-classes-close">Close icon</h3>
|
||||||
<p>Use the generic close icon for dismissing content like modals and alerts.</p>
|
<p>Use the generic close icon for dismissing content like modals and alerts.</p>
|
||||||
<div class="bs-example" data-example-id="close-icon">
|
<div class="bs-example" data-example-id="close-icon">
|
||||||
<p><button type="button" class="close"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button></p>
|
<p><button type="button" class="close" aria-label="Close"><span aria-hidden="true">×</span></button></p>
|
||||||
</div>
|
</div>
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<button type="button" class="close"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -220,10 +220,9 @@ You can use the mark tag to <mark>highlight</mark> text.
|
|||||||
|
|
||||||
<!-- Abbreviations -->
|
<!-- Abbreviations -->
|
||||||
<h2 id="type-abbreviations">Abbreviations</h2>
|
<h2 id="type-abbreviations">Abbreviations</h2>
|
||||||
<p>Stylized implementation of HTML's <code><abbr></code> element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a <code>title</code> attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover.</p>
|
<p>Stylized implementation of HTML's <code><abbr></code> element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a <code>title</code> attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover and to users of assistive technologies.</p>
|
||||||
|
|
||||||
<h3>Basic abbreviation</h3>
|
<h3>Basic abbreviation</h3>
|
||||||
<p>For expanded text on long hover of an abbreviation, include the <code>title</code> attribute with the <code><abbr></code> element.</p>
|
|
||||||
<div class="bs-example" data-example-id="simple-abbr">
|
<div class="bs-example" data-example-id="simple-abbr">
|
||||||
<p>An abbreviation of the word attribute is <abbr title="attribute">attr</abbr>.</p>
|
<p>An abbreviation of the word attribute is <abbr title="attribute">attr</abbr>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,12 +6,12 @@
|
|||||||
<p>When using a <code>.close</code> button, it must be the first child of the <code>.alert-dismissible</code> and no text content may come before it in the markup.</p>
|
<p>When using a <code>.close</code> button, it must be the first child of the <code>.alert-dismissible</code> and no text content may come before it in the markup.</p>
|
||||||
<div class="bs-example bs-example-standalone" data-example-id="dismissible-alert-js">
|
<div class="bs-example bs-example-standalone" data-example-id="dismissible-alert-js">
|
||||||
<div class="alert alert-warning alert-dismissible fade in" role="alert">
|
<div class="alert alert-warning alert-dismissible fade in" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.
|
<strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible fade in" role="alert">
|
<div class="alert alert-danger alert-dismissible fade in" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4>Oh snap! You got an error!</h4>
|
<h4>Oh snap! You got an error!</h4>
|
||||||
<p>Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.</p>
|
<p>Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.</p>
|
||||||
<p>
|
<p>
|
||||||
@ -27,9 +27,8 @@
|
|||||||
<p>Just add <code>data-dismiss="alert"</code> to your close button to automatically give an alert close functionality. Closing an alert removes it from the DOM.</p>
|
<p>Just add <code>data-dismiss="alert"</code> to your close button to automatically give an alert close functionality. Closing an alert removes it from the DOM.</p>
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<button type="button" class="close" data-dismiss="alert">
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
<span class="sr-only">Close</span>
|
|
||||||
</button>
|
</button>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title">Modal title</h4>
|
<h4 class="modal-title">Modal title</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -50,7 +50,7 @@
|
|||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title">Modal title</h4>
|
<h4 class="modal-title">Modal title</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -73,7 +73,7 @@
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
|
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -124,7 +124,7 @@
|
|||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
|
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -186,7 +186,7 @@
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title" id="myLargeModalLabel">Large modal</h4>
|
<h4 class="modal-title" id="myLargeModalLabel">Large modal</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -200,7 +200,7 @@
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title" id="mySmallModalLabel">Small modal</h4>
|
<h4 class="modal-title" id="mySmallModalLabel">Small modal</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -230,7 +230,7 @@
|
|||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title" id="exampleModalLabel">New message</h4>
|
<h4 class="modal-title" id="exampleModalLabel">New message</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -263,7 +263,7 @@
|
|||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title" id="exampleModalLabel">New message</h4>
|
<h4 class="modal-title" id="exampleModalLabel">New message</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
{{ content }}
|
{{ content }}
|
||||||
</div>
|
</div>
|
||||||
{% unless page.fullwidth == true %}
|
{% unless page.fullwidth == true %}
|
||||||
<div class="col-md-3">
|
<div class="col-md-3" role="complementary">
|
||||||
<div class="bs-docs-sidebar hidden-print hidden-xs hidden-sm" role="complementary">
|
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||||
<ul class="nav bs-docs-sidenav">
|
<ul class="nav bs-docs-sidenav">
|
||||||
{% if page.slug == "getting-started" %}
|
{% if page.slug == "getting-started" %}
|
||||||
{% include nav/getting-started.html %}
|
{% include nav/getting-started.html %}
|
||||||
@ -53,7 +53,7 @@
|
|||||||
Preview theme
|
Preview theme
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
{% endunless %}
|
{% endunless %}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user