progress.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/utils' as *;
  3. @use 'common/var' as *;
  4. @include b(progress) {
  5. position: relative;
  6. line-height: 1;
  7. display: flex;
  8. align-items: center;
  9. @include e(text) {
  10. font-size: 14px;
  11. color: getCssVar('text-color', 'regular');
  12. margin-left: 5px;
  13. min-width: 50px;
  14. line-height: 1;
  15. i {
  16. vertical-align: middle;
  17. display: block;
  18. }
  19. }
  20. @include m((circle, dashboard)) {
  21. display: inline-block;
  22. .#{$namespace}-progress__text {
  23. position: absolute;
  24. top: 50%;
  25. left: 0;
  26. width: 100%;
  27. text-align: center;
  28. margin: 0;
  29. transform: translate(0, -50%);
  30. i {
  31. vertical-align: middle;
  32. display: inline-block;
  33. }
  34. }
  35. }
  36. @include m(without-text) {
  37. .#{$namespace}-progress__text {
  38. display: none;
  39. }
  40. .#{$namespace}-progress-bar {
  41. padding-right: 0;
  42. margin-right: 0;
  43. display: block;
  44. }
  45. }
  46. @include m(text-inside) {
  47. .#{$namespace}-progress-bar {
  48. padding-right: 0;
  49. margin-right: 0;
  50. }
  51. }
  52. @include when(success) {
  53. .#{$namespace}-progress-bar__inner {
  54. background-color: getCssVar('color-success');
  55. }
  56. .#{$namespace}-progress__text {
  57. color: getCssVar('color-success');
  58. }
  59. }
  60. @include when(warning) {
  61. .#{$namespace}-progress-bar__inner {
  62. background-color: getCssVar('color-warning');
  63. }
  64. .#{$namespace}-progress__text {
  65. color: getCssVar('color-warning');
  66. }
  67. }
  68. @include when(exception) {
  69. .#{$namespace}-progress-bar__inner {
  70. background-color: getCssVar('color-danger');
  71. }
  72. .#{$namespace}-progress__text {
  73. color: getCssVar('color-danger');
  74. }
  75. }
  76. }
  77. @include b(progress-bar) {
  78. flex-grow: 1;
  79. box-sizing: border-box;
  80. @include e(outer) {
  81. height: 6px;
  82. border-radius: 100px;
  83. background-color: getCssVar('border-color-lighter');
  84. overflow: hidden;
  85. position: relative;
  86. vertical-align: middle;
  87. }
  88. @include e(inner) {
  89. position: absolute;
  90. left: 0;
  91. top: 0;
  92. height: 100%;
  93. background-color: getCssVar('color-primary');
  94. text-align: right;
  95. border-radius: 100px;
  96. line-height: 1;
  97. white-space: nowrap;
  98. transition: width 0.6s ease;
  99. @include utils-vertical-center;
  100. @include m(indeterminate) {
  101. transform: translateZ(0);
  102. animation: indeterminate 3s infinite;
  103. }
  104. @include m(striped) {
  105. background-image: linear-gradient(
  106. 45deg,
  107. rgba(0, 0, 0, 0.1) 25%,
  108. transparent 25%,
  109. transparent 50%,
  110. rgba(0, 0, 0, 0.1) 50%,
  111. rgba(0, 0, 0, 0.1) 75%,
  112. transparent 75%,
  113. transparent
  114. );
  115. background-size: 1.25em 1.25em;
  116. &.#{$namespace}-progress-bar__inner--striped-flow {
  117. animation: striped-flow 3s linear infinite;
  118. }
  119. }
  120. }
  121. @include e(innerText) {
  122. display: inline-block;
  123. vertical-align: middle;
  124. color: $color-white;
  125. font-size: 12px;
  126. margin: 0 5px;
  127. }
  128. }
  129. @keyframes progress {
  130. 0% {
  131. background-position: 0 0;
  132. }
  133. 100% {
  134. background-position: 32px 0;
  135. }
  136. }
  137. @keyframes indeterminate {
  138. 0% {
  139. left: -100%;
  140. }
  141. 100% {
  142. left: 100%;
  143. }
  144. }
  145. @keyframes striped-flow {
  146. 0% {
  147. background-position: -100%;
  148. }
  149. 100% {
  150. background-position: 100%;
  151. }
  152. }