step.scss 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. @use 'mixins/mixins' as *;
  2. @use 'common/var' as *;
  3. @include b(step) {
  4. position: relative;
  5. flex-shrink: 1;
  6. @include pseudo(last-of-type) {
  7. @include e(line) {
  8. display: none;
  9. }
  10. // 只有未设置 space 的情况下才自适应宽度
  11. @include when(flex) {
  12. flex-basis: auto !important;
  13. flex-shrink: 0;
  14. flex-grow: 0;
  15. }
  16. @include e((main, description)) {
  17. padding-right: 0;
  18. }
  19. }
  20. @include e(head) {
  21. position: relative;
  22. width: 100%;
  23. @include when(process) {
  24. color: getCssVar('text-color', 'primary');
  25. border-color: getCssVar('text-color', 'primary');
  26. }
  27. @include when(wait) {
  28. color: getCssVar('text-color', 'placeholder');
  29. border-color: getCssVar('text-color', 'placeholder');
  30. }
  31. @include when(success) {
  32. color: getCssVar('color-success');
  33. border-color: getCssVar('color-success');
  34. }
  35. @include when(error) {
  36. color: getCssVar('color-danger');
  37. border-color: getCssVar('color-danger');
  38. }
  39. @include when(finish) {
  40. color: getCssVar('color-primary');
  41. border-color: getCssVar('color-primary');
  42. }
  43. }
  44. @include e(icon) {
  45. position: relative;
  46. z-index: 1;
  47. display: inline-flex;
  48. justify-content: center;
  49. align-items: center;
  50. width: 24px;
  51. height: 24px;
  52. font-size: 14px;
  53. box-sizing: border-box;
  54. background: getCssVar('bg-color');
  55. transition: 0.15s ease-out;
  56. @include when(text) {
  57. border-radius: 50%;
  58. border: 2px solid;
  59. border-color: inherit;
  60. }
  61. @include when(icon) {
  62. width: 40px;
  63. }
  64. }
  65. @include e(icon-inner) {
  66. display: inline-block;
  67. user-select: none;
  68. text-align: center;
  69. font-weight: bold;
  70. line-height: 1;
  71. color: inherit;
  72. &[class*='#{$namespace}-icon']:not(.is-status) {
  73. font-size: 25px;
  74. font-weight: normal;
  75. }
  76. // 组件自身表示状态的图标
  77. @include when(status) {
  78. transform: translateY(1px);
  79. }
  80. }
  81. @include e(line) {
  82. position: absolute;
  83. border-color: inherit;
  84. background-color: getCssVar('text-color', 'placeholder');
  85. }
  86. @include e(line-inner) {
  87. display: block;
  88. border-width: 1px;
  89. border-style: solid;
  90. border-color: inherit;
  91. transition: 0.15s ease-out;
  92. box-sizing: border-box;
  93. width: 0;
  94. height: 0;
  95. }
  96. @include e(main) {
  97. white-space: normal;
  98. text-align: left;
  99. }
  100. @include e(title) {
  101. font-size: 16px;
  102. line-height: 38px;
  103. @include when(process) {
  104. font-weight: bold;
  105. color: getCssVar('text-color', 'primary');
  106. }
  107. @include when(wait) {
  108. color: getCssVar('text-color', 'placeholder');
  109. }
  110. @include when(success) {
  111. color: getCssVar('color-success');
  112. }
  113. @include when(error) {
  114. color: getCssVar('color-danger');
  115. }
  116. @include when(finish) {
  117. color: getCssVar('color-primary');
  118. }
  119. }
  120. @include e(description) {
  121. padding-right: 10%;
  122. margin-top: -5px;
  123. font-size: 12px;
  124. line-height: 20px;
  125. font-weight: normal;
  126. @include when(process) {
  127. color: getCssVar('text-color', 'primary');
  128. }
  129. @include when(wait) {
  130. color: getCssVar('text-color', 'placeholder');
  131. }
  132. @include when(success) {
  133. color: getCssVar('color-success');
  134. }
  135. @include when(error) {
  136. color: getCssVar('color-danger');
  137. }
  138. @include when(finish) {
  139. color: getCssVar('color-primary');
  140. }
  141. }
  142. @include when(horizontal) {
  143. display: inline-block;
  144. @include e(line) {
  145. height: 2px;
  146. top: 11px;
  147. left: 0;
  148. right: 0;
  149. }
  150. }
  151. @include when(vertical) {
  152. display: flex;
  153. @include e(head) {
  154. flex-grow: 0;
  155. width: 24px;
  156. }
  157. @include e(main) {
  158. padding-left: 10px;
  159. flex-grow: 1;
  160. }
  161. @include e(title) {
  162. line-height: 24px;
  163. padding-bottom: 8px;
  164. }
  165. @include e(line) {
  166. width: 2px;
  167. top: 0;
  168. bottom: 0;
  169. left: 11px;
  170. }
  171. @include e(icon) {
  172. @include when(icon) {
  173. width: 24px;
  174. }
  175. }
  176. }
  177. @include when(center) {
  178. @include e(head) {
  179. text-align: center;
  180. }
  181. @include e(main) {
  182. text-align: center;
  183. }
  184. @include e(description) {
  185. padding-left: 20%;
  186. padding-right: 20%;
  187. }
  188. @include e(line) {
  189. left: 50%;
  190. right: -50%;
  191. }
  192. }
  193. @include when(simple) {
  194. display: flex;
  195. align-items: center;
  196. @include e(head) {
  197. width: auto;
  198. font-size: 0;
  199. padding-right: 10px;
  200. }
  201. @include e(icon) {
  202. background: transparent;
  203. width: 16px;
  204. height: 16px;
  205. font-size: 12px;
  206. }
  207. @include e(icon-inner) {
  208. &[class*='#{$namespace}-icon']:not(.is-status) {
  209. font-size: 18px;
  210. }
  211. &.is-status {
  212. transform: scale(0.8) translateY(1px);
  213. }
  214. }
  215. @include e(main) {
  216. position: relative;
  217. display: flex;
  218. align-items: stretch;
  219. flex-grow: 1;
  220. }
  221. @include e(title) {
  222. font-size: 16px;
  223. line-height: 20px;
  224. }
  225. @include pseudo('not(:last-of-type)') {
  226. @include e(title) {
  227. max-width: 50%;
  228. overflow-wrap: break-word;
  229. }
  230. }
  231. @include e(arrow) {
  232. flex-grow: 1;
  233. display: flex;
  234. align-items: center;
  235. justify-content: center;
  236. &::before,
  237. &::after {
  238. content: '';
  239. display: inline-block;
  240. position: absolute;
  241. height: 15px;
  242. width: 1px;
  243. background: getCssVar('text-color', 'placeholder');
  244. }
  245. &::before {
  246. transform: rotate(-45deg) translateY(-4px);
  247. transform-origin: 0 0;
  248. }
  249. &::after {
  250. transform: rotate(45deg) translateY(4px);
  251. transform-origin: 100% 100%;
  252. }
  253. }
  254. @include pseudo(last-of-type) {
  255. @include e(arrow) {
  256. display: none;
  257. }
  258. }
  259. }
  260. }