// Material design does not have specs for striped progress bars // so striped progress bars have been styled according to the "buffer" variation of linear indicator // (https://material.google.com/components/progress-activity.html#progress-activity-types-of-indicators) .progress { display: flex; overflow: hidden; position: relative; z-index: 1; } .progress-bar { border-bottom: $progress-bar-height solid $progress-bar-bg; @each $color, $values in $theme-colors { &.bg-#{$color} { background-color: transparent !important; // stylelint-disable-line declaration-no-important border-bottom-color: map-get(theme-color($color), color); &::after { background-color: map-get(theme-color($color), lighter); } } } &::after { background-color: $progress-bg; content: ''; display: block; height: $progress-bar-height; position: absolute; right: 0; bottom: 0; left: 0; z-index: -1; } } // Animated & striped .progress-bar-animated { &::before { animation-direction: reverse; animation-duration: $transition-duration-mobile; animation-iteration-count: infinite; animation-name: progress-bar-animation; animation-timing-function: linear; @include media-breakpoint-up(sm) { animation-duration: $transition-duration-tablet; } @include media-breakpoint-up(lg) { animation-duration: $transition-duration-desktop; } } } .progress-bar-animated, .progress-bar-striped { box-sizing: content-box; position: relative; @each $color, $values in $theme-colors { &.bg-#{$color}::before { // stylelint-disable value-no-vendor-prefix background-image: repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, map-get(theme-color($color), lighter), map-get(theme-color($color), lighter) #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%); background-image: -webkit-repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, map-get(theme-color($color), lighter), map-get(theme-color($color), lighter) #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%); background-image: -moz-repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, map-get(theme-color($color), lighter), map-get(theme-color($color), lighter) #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%); // stylelint-enable } } &[style*='width:100%'], &[style*='width: 100%'] { border-right: 0; } &::after { @include border-right-radius($progress-bar-border-radius); right: ($progress-bar-height * -6); bottom: ($progress-bar-height * -1); } &::before { // stylelint-disable value-no-vendor-prefix background-image: repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, #{$progress-bg}, #{$progress-bg} #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%); background-image: -webkit-repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, #{$progress-bg}, #{$progress-bg} #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%); background-image: -moz-repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, #{$progress-bg}, #{$progress-bg} #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%); // stylelint-enable background-position: 0 0; background-repeat: repeat-x; background-size: ($progress-bar-height * 3) ($progress-bar-height * 3); content: ''; display: block; height: $progress-bar-height; position: absolute; right: -100vw; bottom: ($progress-bar-height * -1); left: 0; z-index: -1; } } @keyframes progress-bar-animation { from { background-position: 0 0; } to { background-position: ($progress-bar-height * 3) 0; } } // Indeterminate .progress-bar-indeterminate { border-bottom-color: $progress-bg; position: relative; width: 100%; @each $color, $values in $theme-colors { &.bg-#{$color} { border-bottom-color: map-get(theme-color($color), lighter); &::after, &::before { background-color: map-get(theme-color($color), color); } &::before { background-image: none; } } } &::after, &::before { @include border-radius($progress-bar-border-radius); animation-duration: 2s; animation-iteration-count: infinite; animation-timing-function: linear; background-color: $progress-bar-bg; width: 0%; } &::after { animation-name: progress-bar-indeterminate-after; bottom: ($progress-bar-height * -1); z-index: 0; } &::before { animation-name: progress-bar-indeterminate-before; content: ''; display: block; height: $progress-bar-height; position: absolute; bottom: ($progress-bar-height * -1); z-index: 0; } } @keyframes progress-bar-indeterminate-after { 0% { left: 0%; width: 0%; } 50% { left: 25%; width: 75%; } 75% { left: 100%; width: 0%; } } @keyframes progress-bar-indeterminate-before { 0%, 62.5% { left: 0%; width: 0%; } 71.875% { left: 0%; width: 25%; } 81.25% { left: 25%; width: 50%; } 100% { left: 100%; width: 25%; } }