mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-20 17:54:23 +01:00
Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into v4-dev
This commit is contained in:
commit
f2e912bb0e
@ -28,6 +28,36 @@ Badges scale to match the size of the immediate parent element by using relative
|
||||
<h6>Example heading <span class="badge badge-secondary">New</span></h6>
|
||||
{% endhighlight %}
|
||||
|
||||
Badges can be used as part of links or buttons to provide a counter.
|
||||
|
||||
<div class="bd-example">
|
||||
<button class="btn">
|
||||
Notifications <span class="badge badge-secondary">4</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
<button class="btn">
|
||||
Notifications <span class="badge badge-secondary">4</span>
|
||||
</button>
|
||||
{% endhighlight %}
|
||||
|
||||
Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link or button. Unless the context is clear (as with the "Notifications" example, where it is arguably understandable that the "4" gives a count of the number of notifications), consider including additional context – for instance using a visually hidden piece of additional text.
|
||||
|
||||
<div class="bd-example">
|
||||
<button class="btn">
|
||||
Profile <span class="badge badge-secondary">9</span>
|
||||
<span class="sr-only">unread messages</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% highlight html %}
|
||||
<button class="btn">
|
||||
Profile <span class="badge badge-secondary">9</span>
|
||||
<span class="sr-only">unread messages</span>
|
||||
</button>
|
||||
{% endhighlight %}
|
||||
|
||||
## Contextual variations
|
||||
|
||||
Add any of the below mentioned modifier classes to change the appearance of a badge.
|
||||
|
@ -113,7 +113,7 @@ Using the [card]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/card
|
||||
</div>
|
||||
{% endexample %}
|
||||
|
||||
You can also create accordions with custom markup. Add the `data-children` attribute and specify a set of sibling elements to toggle (e.g., `.item`). Then, use the same attributes and classes as shown above for connectinh toggles to their associated content.
|
||||
You can also create accordions with custom markup. Add the `data-children` attribute and specify a set of sibling elements to toggle (e.g., `.item`). Then, use the same attributes and classes as shown above for connecting toggles to their associated content.
|
||||
|
||||
{% example html %}
|
||||
<div id="exampleAccordion" data-children=".item">
|
||||
|
@ -12,15 +12,7 @@
|
||||
@media print {
|
||||
*,
|
||||
*::before,
|
||||
*::after,
|
||||
p::first-letter,
|
||||
div::first-letter,
|
||||
blockquote::first-letter,
|
||||
li::first-letter,
|
||||
p::first-line,
|
||||
div::first-line,
|
||||
blockquote::first-line,
|
||||
li::first-line {
|
||||
*::after {
|
||||
// Bootstrap specific; comment out `color` and `background`
|
||||
//color: #000 !important; // Black prints faster:
|
||||
// http://www.sanbeiji.com/archives/953
|
||||
|
Loading…
x
Reference in New Issue
Block a user