You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.0 KiB

7 months ago
  1. // Disable animation if transitions are disabled
  2. // scss-docs-start progress-keyframes
  3. @if $enable-transitions {
  4. @keyframes progress-bar-stripes {
  5. 0% { background-position-x: $progress-height; }
  6. }
  7. }
  8. // scss-docs-end progress-keyframes
  9. .progress,
  10. .progress-stacked {
  11. // scss-docs-start progress-css-vars
  12. --#{$prefix}progress-height: #{$progress-height};
  13. @include rfs($progress-font-size, --#{$prefix}progress-font-size);
  14. --#{$prefix}progress-bg: #{$progress-bg};
  15. --#{$prefix}progress-border-radius: #{$progress-border-radius};
  16. --#{$prefix}progress-box-shadow: #{$progress-box-shadow};
  17. --#{$prefix}progress-bar-color: #{$progress-bar-color};
  18. --#{$prefix}progress-bar-bg: #{$progress-bar-bg};
  19. --#{$prefix}progress-bar-transition: #{$progress-bar-transition};
  20. // scss-docs-end progress-css-vars
  21. display: flex;
  22. height: var(--#{$prefix}progress-height);
  23. overflow: hidden; // force rounded corners by cropping it
  24. @include font-size(var(--#{$prefix}progress-font-size));
  25. background-color: var(--#{$prefix}progress-bg);
  26. @include border-radius(var(--#{$prefix}progress-border-radius));
  27. @include box-shadow(var(--#{$prefix}progress-box-shadow));
  28. }
  29. .progress-bar {
  30. display: flex;
  31. flex-direction: column;
  32. justify-content: center;
  33. overflow: hidden;
  34. color: var(--#{$prefix}progress-bar-color);
  35. text-align: center;
  36. white-space: nowrap;
  37. background-color: var(--#{$prefix}progress-bar-bg);
  38. @include transition(var(--#{$prefix}progress-bar-transition));
  39. }
  40. .progress-bar-striped {
  41. @include gradient-striped();
  42. background-size: var(--#{$prefix}progress-height) var(--#{$prefix}progress-height);
  43. }
  44. .progress-stacked > .progress {
  45. overflow: visible;
  46. }
  47. .progress-stacked > .progress > .progress-bar {
  48. width: 100%;
  49. }
  50. @if $enable-transitions {
  51. .progress-bar-animated {
  52. animation: $progress-bar-animation-timing progress-bar-stripes;
  53. @if $enable-reduced-motion {
  54. @media (prefers-reduced-motion: reduce) {
  55. animation: none;
  56. }
  57. }
  58. }
  59. }