2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-11 18:02:28 +03:00

Remove custom example plugin. (#25784)

This commit is contained in:
m5o
2018-03-14 16:44:38 +01:00
committed by XhmikosR
parent 03b7f52e82
commit d01b4eb025
41 changed files with 923 additions and 695 deletions
+15 -10
View File
@@ -30,31 +30,34 @@ Badges scale to match the size of the immediate parent element by using relative
Badges can be used as part of links or buttons to provide a counter.
{% example html %}
{% capture example %}
<button type="button" class="btn btn-primary">
Notifications <span class="badge badge-light">4</span>
</button>
{% endexample %}
{% endcapture %}
{% include example.html content=example %}
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 understood that the "4" is the number of notifications), consider including additional context with a visually hidden piece of additional text.
{% example html %}
{% capture example %}
<button type="button" class="btn btn-primary">
Profile <span class="badge badge-light">9</span>
<span class="sr-only">unread messages</span>
</button>
{% endexample %}
{% endcapture %}
{% include example.html content=example %}
## Contextual variations
Add any of the below mentioned modifier classes to change the appearance of a badge.
{% example html %}
{% capture example %}
{% for color in site.data.theme-colors %}
<span class="badge badge-{{ color.name }}">{{ color.name | capitalize }}</span>{% endfor %}
{% endexample %}
{% endcapture %}
{% include example.html content=example %}
{% include callout-warning-color-assistive-technologies.md %}
@@ -62,16 +65,18 @@ Add any of the below mentioned modifier classes to change the appearance of a ba
Use the `.badge-pill` modifier class to make badges more rounded (with a larger `border-radius` and additional horizontal `padding`). Useful if you miss the badges from v3.
{% example html %}
{% capture example %}
{% for color in site.data.theme-colors %}
<span class="badge badge-pill badge-{{ color.name }}">{{ color.name | capitalize }}</span>{% endfor %}
{% endexample %}
{% endcapture %}
{% include example.html content=example %}
## Links
Using the contextual `.badge-*` classes on an `<a>` element quickly provide _actionable_ badges with hover and focus states.
{% example html %}
{% capture example %}
{% for color in site.data.theme-colors %}
<a href="#" class="badge badge-{{ color.name }}">{{ color.name | capitalize }}</a>{% endfor %}
{% endexample %}
{% endcapture %}
{% include example.html content=example %}