| 
									
										
										
										
											2019-01-15 08:51:11 +08:00
										 |  |  | // Disable animation if transitions are disabled
 | 
					
						
							| 
									
										
										
										
											2021-02-11 11:29:59 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // scss-docs-start progress-keyframes
 | 
					
						
							| 
									
										
										
										
											2019-01-15 08:51:11 +08:00
										 |  |  | @if $enable-transitions { | 
					
						
							|  |  |  |   @keyframes progress-bar-stripes { | 
					
						
							| 
									
										
										
										
											2019-05-02 16:03:28 +08:00
										 |  |  |     0% { background-position-x: $progress-height; } | 
					
						
							| 
									
										
										
										
											2019-01-15 08:51:11 +08:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2012-01-08 07:52:57 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2021-02-11 11:29:59 +08:00
										 |  |  | // scss-docs-end progress-keyframes
 | 
					
						
							| 
									
										
										
										
											2012-01-08 07:52:57 +08: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 15:07:48 +08:00
										 |  |  | .progress, | 
					
						
							|  |  |  | .progress-stacked { | 
					
						
							| 
									
										
										
										
											2022-03-19 00:02:03 +08:00
										 |  |  |   // scss-docs-start progress-css-vars
 | 
					
						
							|  |  |  |   --#{$prefix}progress-height: #{$progress-height}; | 
					
						
							|  |  |  |   @include rfs($progress-font-size, --#{$prefix}progress-font-size); | 
					
						
							| 
									
										
										
										
											2022-05-23 10:24:08 +08:00
										 |  |  |   --#{$prefix}progress-bg: #{$progress-bg}; | 
					
						
							| 
									
										
										
										
											2022-03-19 00:02:03 +08: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-30 06:56:28 +08:00
										 |  |  |   display: flex; | 
					
						
							| 
									
										
										
										
											2022-03-19 00:02:03 +08:00
										 |  |  |   height: var(--#{$prefix}progress-height); | 
					
						
							| 
									
										
										
										
											2016-11-27 10:46:46 +08:00
										 |  |  |   overflow: hidden; // force rounded corners by cropping it
 | 
					
						
							| 
									
										
										
										
											2022-03-19 00:02:03 +08: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-11 06:29:54 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2017-01-22 04:32:38 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-30 06:56:28 +08:00
										 |  |  | .progress-bar { | 
					
						
							| 
									
										
										
										
											2017-05-27 01:48:57 +08:00
										 |  |  |   display: flex; | 
					
						
							| 
									
										
										
										
											2017-11-07 01:57:25 +08:00
										 |  |  |   flex-direction: column; | 
					
						
							| 
									
										
										
										
											2017-05-27 02:11:10 +08:00
										 |  |  |   justify-content: center; | 
					
						
							| 
									
										
										
										
											2019-11-04 20:37:13 +08:00
										 |  |  |   overflow: hidden; | 
					
						
							| 
									
										
										
										
											2022-03-19 00:02:03 +08:00
										 |  |  |   color: var(--#{$prefix}progress-bar-color); | 
					
						
							| 
									
										
										
										
											2017-11-07 01:57:25 +08:00
										 |  |  |   text-align: center; | 
					
						
							| 
									
										
										
										
											2018-02-12 08:46:54 +08:00
										 |  |  |   white-space: nowrap; | 
					
						
							| 
									
										
										
										
											2022-03-19 00:02:03 +08:00
										 |  |  |   background-color: var(--#{$prefix}progress-bar-bg); | 
					
						
							|  |  |  |   @include transition(var(--#{$prefix}progress-bar-transition)); | 
					
						
							| 
									
										
										
										
											2012-01-08 07:52:57 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-30 06:56:28 +08:00
										 |  |  | .progress-bar-striped { | 
					
						
							| 
									
										
										
										
											2014-12-03 06:02:35 +08:00
										 |  |  |   @include gradient-striped(); | 
					
						
							| 
									
										
										
										
											2022-03-19 00:02:03 +08:00
										 |  |  |   background-size: var(--#{$prefix}progress-height) var(--#{$prefix}progress-height); | 
					
						
							| 
									
										
										
										
											2015-12-11 06:29:54 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2012-01-08 07:52:57 +08: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 15:07:48 +08:00
										 |  |  | .progress-stacked > .progress { | 
					
						
							|  |  |  |   overflow: visible; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .progress-stacked > .progress > .progress-bar { | 
					
						
							|  |  |  |   width: 100%; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-15 08:51:11 +08:00
										 |  |  | @if $enable-transitions { | 
					
						
							|  |  |  |   .progress-bar-animated { | 
					
						
							| 
									
										
										
										
											2020-11-12 00:27:12 +08:00
										 |  |  |     animation: $progress-bar-animation-timing progress-bar-stripes; | 
					
						
							| 
									
										
										
										
											2019-01-15 08:51:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-14 08:48:19 +08:00
										 |  |  |     @if $enable-reduced-motion { | 
					
						
							| 
									
										
										
										
											2019-03-21 21:59:02 +08:00
										 |  |  |       @media (prefers-reduced-motion: reduce) { | 
					
						
							|  |  |  |         animation: none; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2019-01-15 08:51:11 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2012-02-24 18:23:04 +08:00
										 |  |  | } |