mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-02 14:24:19 +01:00
Docs: Progress fix + proposal (#38014)
* Fix + proposal * fix(review) --------- Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
This commit is contained in:
parent
70bad9b1b6
commit
7bffd6ea8d
@ -15,7 +15,7 @@ toc: true
|
|||||||
Progress components are built with two HTML elements, some CSS to set the width, and a few attributes. We don't use [the HTML5 `<progress>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress), ensuring you can stack progress bars, animate them, and place text labels over them.
|
Progress components are built with two HTML elements, some CSS to set the width, and a few attributes. We don't use [the HTML5 `<progress>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress), ensuring you can stack progress bars, animate them, and place text labels over them.
|
||||||
|
|
||||||
- We use the `.progress` as a wrapper to indicate the max value of the progress bar.
|
- We use the `.progress` as a wrapper to indicate the max value of the progress bar.
|
||||||
- The `.progress` wrapper also requires a `role="progress"` and `aria` attributes to make it accessible, including an accessible name (using `aria-label`, `aria-labelledby`, or similar).
|
- The `.progress` wrapper also requires a `role="progressbar"` and `aria` attributes to make it accessible, including an accessible name (using `aria-label`, `aria-labelledby`, or similar).
|
||||||
- We use the inner `.progress-bar` purely for the visual bar and label.
|
- We use the inner `.progress-bar` purely for the visual bar and label.
|
||||||
- The `.progress-bar` requires an inline style, utility class, or custom CSS to set its width.
|
- The `.progress-bar` requires an inline style, utility class, or custom CSS to set its width.
|
||||||
- We provide a special `.progress-stacked` class to create multiple/stacked progress bars.
|
- We provide a special `.progress-stacked` class to create multiple/stacked progress bars.
|
||||||
@ -57,7 +57,7 @@ Bootstrap provides a handful of [utilities for setting width]({{< docsref "/util
|
|||||||
You only set a `height` value on the `.progress` container, so if you change that value, the inner `.progress-bar` will automatically resize accordingly.
|
You only set a `height` value on the `.progress` container, so if you change that value, the inner `.progress-bar` will automatically resize accordingly.
|
||||||
|
|
||||||
{{< example >}}
|
{{< example >}}
|
||||||
<div class="progress" role="progressbar" aria-label="Example 1px high" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" style="height: 1px">
|
<div class="progress" role="progressbar" aria-label="Example 1px high" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" style="height: 1px">
|
||||||
<div class="progress-bar" style="width: 25%"></div>
|
<div class="progress-bar" style="width: 25%"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress" role="progressbar" aria-label="Example 20px high" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" style="height: 20px">
|
<div class="progress" role="progressbar" aria-label="Example 20px high" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" style="height: 20px">
|
||||||
|
Loading…
Reference in New Issue
Block a user