2019-01-15 01:51:11 +01:00
|
|
|
// Disable animation if transitions are disabled
|
2021-02-11 04:29:59 +01:00
|
|
|
|
|
|
|
// scss-docs-start progress-keyframes
|
2019-01-15 01:51:11 +01:00
|
|
|
@if $enable-transitions {
|
|
|
|
@keyframes progress-bar-stripes {
|
2019-05-02 10:03:28 +02:00
|
|
|
0% { background-position-x: $progress-height; }
|
2019-01-15 01:51:11 +01:00
|
|
|
}
|
2012-01-08 00:52:57 +01:00
|
|
|
}
|
2021-02-11 04:29:59 +01:00
|
|
|
// scss-docs-end progress-keyframes
|
2012-01-08 00:52:57 +01:00
|
|
|
|
Rework progress bar markup and styles (#36831)
* Rework progress bar markup and styles
Logically moves the various `role` and `aria-` attributes to the `.progress` element itself, leaving the `.progress-bar` to be used purely for the visual presentation. This fixes the problem #36736 that in certain browser/AT combinations, zero-value/zero-width progress bars are completely ignored and not announced.
For multiple/stacked progress bars, this PR introduces a new wrapper and class `.progress-stacked`, to accommodate for the fact that with the more logical structure above, we need full `.progress` elements with child `.progress-bar` elements, and can't get away with the fudge we had before of having a single `.progress` with multiple `.progress-bar`s.
Note that the old markup structures still work with this change, so this could be considered a non-breaking change - though one we definitely want to highlight as it's more accessible (as it now guarantees that zero-value/zero-width progress bars, whether on their own or as part of a multi/stacked bar, are actually announced)
* Add a note about progress bar change in migration guide
* Add notes with old markup examples and explanation
* Fix bundlewatch
* Update site/content/docs/5.2/components/progress.md
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
* Reintroduce deleted styles
Turns out they're needed for correct positioning of text inside progress bar
* Move changes in markup to Migrationg guide, link to that from top of progress page, rewrite some content
* Fix typo in callout
* Clarify "Sizing" section
* Remove redundant "now"
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
Co-authored-by: Julien Déramond <juderamond@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
Co-authored-by: Mark Otto <markd.otto@gmail.com>
2022-11-29 08:07:48 +01:00
|
|
|
.progress,
|
|
|
|
.progress-stacked {
|
2022-03-18 17:02:03 +01:00
|
|
|
// scss-docs-start progress-css-vars
|
|
|
|
--#{$prefix}progress-height: #{$progress-height};
|
|
|
|
@include rfs($progress-font-size, --#{$prefix}progress-font-size);
|
2022-05-23 04:24:08 +02:00
|
|
|
--#{$prefix}progress-bg: #{$progress-bg};
|
2022-03-18 17:02:03 +01:00
|
|
|
--#{$prefix}progress-border-radius: #{$progress-border-radius};
|
|
|
|
--#{$prefix}progress-box-shadow: #{$progress-box-shadow};
|
|
|
|
--#{$prefix}progress-bar-color: #{$progress-bar-color};
|
|
|
|
--#{$prefix}progress-bar-bg: #{$progress-bar-bg};
|
|
|
|
--#{$prefix}progress-bar-transition: #{$progress-bar-transition};
|
|
|
|
// scss-docs-end progress-css-vars
|
|
|
|
|
2016-12-29 23:56:28 +01:00
|
|
|
display: flex;
|
2022-03-18 17:02:03 +01:00
|
|
|
height: var(--#{$prefix}progress-height);
|
2016-11-27 03:46:46 +01:00
|
|
|
overflow: hidden; // force rounded corners by cropping it
|
2022-03-18 17:02:03 +01:00
|
|
|
@include font-size(var(--#{$prefix}progress-font-size));
|
|
|
|
background-color: var(--#{$prefix}progress-bg);
|
|
|
|
@include border-radius(var(--#{$prefix}progress-border-radius));
|
|
|
|
@include box-shadow(var(--#{$prefix}progress-box-shadow));
|
2015-12-10 23:29:54 +01:00
|
|
|
}
|
2017-01-21 21:32:38 +01:00
|
|
|
|
2016-12-29 23:56:28 +01:00
|
|
|
.progress-bar {
|
2017-05-26 19:48:57 +02:00
|
|
|
display: flex;
|
2017-11-06 18:57:25 +01:00
|
|
|
flex-direction: column;
|
2017-05-26 20:11:10 +02:00
|
|
|
justify-content: center;
|
2019-11-04 13:37:13 +01:00
|
|
|
overflow: hidden;
|
2022-03-18 17:02:03 +01:00
|
|
|
color: var(--#{$prefix}progress-bar-color);
|
2017-11-06 18:57:25 +01:00
|
|
|
text-align: center;
|
2018-02-12 01:46:54 +01:00
|
|
|
white-space: nowrap;
|
2022-03-18 17:02:03 +01:00
|
|
|
background-color: var(--#{$prefix}progress-bar-bg);
|
|
|
|
@include transition(var(--#{$prefix}progress-bar-transition));
|
2012-01-08 00:52:57 +01:00
|
|
|
}
|
|
|
|
|
2016-12-29 23:56:28 +01:00
|
|
|
.progress-bar-striped {
|
2014-12-02 23:02:35 +01:00
|
|
|
@include gradient-striped();
|
2022-03-18 17:02:03 +01:00
|
|
|
background-size: var(--#{$prefix}progress-height) var(--#{$prefix}progress-height);
|
2015-12-10 23:29:54 +01:00
|
|
|
}
|
2012-01-08 00:52:57 +01:00
|
|
|
|
Rework progress bar markup and styles (#36831)
* Rework progress bar markup and styles
Logically moves the various `role` and `aria-` attributes to the `.progress` element itself, leaving the `.progress-bar` to be used purely for the visual presentation. This fixes the problem #36736 that in certain browser/AT combinations, zero-value/zero-width progress bars are completely ignored and not announced.
For multiple/stacked progress bars, this PR introduces a new wrapper and class `.progress-stacked`, to accommodate for the fact that with the more logical structure above, we need full `.progress` elements with child `.progress-bar` elements, and can't get away with the fudge we had before of having a single `.progress` with multiple `.progress-bar`s.
Note that the old markup structures still work with this change, so this could be considered a non-breaking change - though one we definitely want to highlight as it's more accessible (as it now guarantees that zero-value/zero-width progress bars, whether on their own or as part of a multi/stacked bar, are actually announced)
* Add a note about progress bar change in migration guide
* Add notes with old markup examples and explanation
* Fix bundlewatch
* Update site/content/docs/5.2/components/progress.md
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
* Reintroduce deleted styles
Turns out they're needed for correct positioning of text inside progress bar
* Move changes in markup to Migrationg guide, link to that from top of progress page, rewrite some content
* Fix typo in callout
* Clarify "Sizing" section
* Remove redundant "now"
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
Co-authored-by: Julien Déramond <juderamond@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
Co-authored-by: Mark Otto <markd.otto@gmail.com>
2022-11-29 08:07:48 +01:00
|
|
|
.progress-stacked > .progress {
|
|
|
|
overflow: visible;
|
|
|
|
}
|
|
|
|
|
|
|
|
.progress-stacked > .progress > .progress-bar {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
2019-01-15 01:51:11 +01:00
|
|
|
@if $enable-transitions {
|
|
|
|
.progress-bar-animated {
|
2020-11-11 17:27:12 +01:00
|
|
|
animation: $progress-bar-animation-timing progress-bar-stripes;
|
2019-01-15 01:51:11 +01:00
|
|
|
|
2020-04-14 02:48:19 +02:00
|
|
|
@if $enable-reduced-motion {
|
2019-03-21 14:59:02 +01:00
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
|
|
animation: none;
|
|
|
|
}
|
2019-01-15 01:51:11 +01:00
|
|
|
}
|
|
|
|
}
|
2012-02-24 11:23:04 +01:00
|
|
|
}
|