index.scss 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. @import './../common/abstracts/_mixin.scss';
  2. @import './../common/abstracts/variable.scss';
  3. .wot-theme-dark {
  4. @include b(button) {
  5. @include when(info) {
  6. background: $-dark-background4;
  7. color: $-dark-color3;
  8. }
  9. @include when(plain) {
  10. background: transparent;
  11. @include when(info) {
  12. color: $-dark-color;
  13. &::after {
  14. border-color: $-dark-background5;
  15. }
  16. }
  17. }
  18. @include when(text) {
  19. @include when(disabled) {
  20. color: $-dark-color-gray;
  21. background: transparent;
  22. }
  23. }
  24. @include when(icon) {
  25. color: $-dark-color;
  26. @include when(disabled) {
  27. color: $-dark-color-gray;
  28. background: transparent;
  29. }
  30. }
  31. }
  32. }
  33. @include b(button) {
  34. margin-left: initial;
  35. margin-right: initial;
  36. position: relative;
  37. display: inline-block;
  38. outline: none;
  39. -webkit-appearance: none;
  40. outline: none;
  41. background: transparent;
  42. box-sizing: border-box;
  43. border: none;
  44. border-radius: 0;
  45. color: $-button-normal-color;
  46. transition: opacity 0.2s;
  47. user-select: none;
  48. font-weight: normal;
  49. &::before {
  50. position: absolute;
  51. top: 50%;
  52. left: 50%;
  53. width: 100%;
  54. height: 100%;
  55. background: $-color-black;
  56. border: inherit;
  57. border-color: $-color-black;
  58. border-radius: inherit;
  59. transform: translate(-50%, -50%);
  60. opacity: 0;
  61. content: ' ';
  62. }
  63. &::after {
  64. border: none;
  65. border-radius: 0;
  66. }
  67. @include e(content) {
  68. display: flex;
  69. justify-content: center;
  70. align-items: center;
  71. height: 100%;
  72. }
  73. @include m(active) {
  74. &:active::before {
  75. opacity: 0.15;
  76. }
  77. }
  78. @include when(disabled) {
  79. opacity: $-button-disabled-opacity;
  80. }
  81. @include e(loading) {
  82. margin-right: 5px;
  83. animation: wd-rotate 0.8s linear infinite;
  84. animation-duration: 2s;
  85. }
  86. @include e(loading-svg) {
  87. width: 100%;
  88. height: 100%;
  89. background-size: cover;
  90. background-repeat: no-repeat;
  91. }
  92. @include when(loading) {}
  93. @include when(primary) {
  94. background: $-button-primary-bg-color;
  95. color: $-button-primary-color;
  96. }
  97. @include when(success) {
  98. background: $-button-success-bg-color;
  99. color: $-button-success-color;
  100. }
  101. @include when(info) {
  102. background: $-button-info-bg-color;
  103. color: $-button-info-color;
  104. }
  105. @include when(warning) {
  106. background: $-button-warning-bg-color;
  107. color: $-button-warning-color;
  108. }
  109. @include when(error) {
  110. background: $-button-error-bg-color;
  111. color: $-button-error-color;
  112. }
  113. @include when(small) {
  114. height: $-button-small-height;
  115. padding: $-button-small-padding;
  116. border-radius: $-button-small-radius;
  117. font-size: $-button-small-fs;
  118. font-weight: normal;
  119. .wd-button__loading {
  120. width: $-button-small-loading;
  121. height: $-button-small-loading;
  122. }
  123. }
  124. @include when(medium) {
  125. height: $-button-medium-height;
  126. padding: $-button-medium-padding;
  127. border-radius: $-button-medium-radius;
  128. font-size: $-button-medium-fs;
  129. min-width: 120px;
  130. @include when(round) {
  131. @include when(icon) {
  132. min-width: 0;
  133. border-radius: 50%;
  134. }
  135. @include when(text) {
  136. border-radius: 0;
  137. min-width: 0;
  138. }
  139. }
  140. .wd-button__loading {
  141. width: $-button-medium-loading;
  142. height: $-button-medium-loading;
  143. }
  144. }
  145. @include when(large) {
  146. height: $-button-large-height;
  147. padding: $-button-large-padding;
  148. border-radius: $-button-large-radius;
  149. font-size: $-button-large-fs;
  150. &::after {
  151. border-radius: $-button-large-radius;
  152. }
  153. .wd-button__loading {
  154. width: $-button-large-loading;
  155. height: $-button-large-loading;
  156. }
  157. }
  158. @include when(round) {
  159. border-radius: 999px;
  160. }
  161. @include when(text) {
  162. color: $-button-primary-bg-color;
  163. min-width: 0;
  164. padding: 4px 0;
  165. &::after {
  166. display: none;
  167. }
  168. &.wd-button--active {
  169. opacity: $-button-text-hover-opacity;
  170. &:active::before {
  171. display: none;
  172. }
  173. }
  174. @include when(disabled) {
  175. color: $-button-normal-disabled-color;
  176. background: transparent;
  177. }
  178. }
  179. @include when(plain) {
  180. background: $-button-plain-bg-color;
  181. border: 1px solid currentColor;
  182. @include when(primary) {
  183. color: $-button-primary-bg-color;
  184. }
  185. @include when(success) {
  186. color: $-button-success-bg-color;
  187. }
  188. @include when(info) {
  189. color: $-button-info-plain-normal-color;
  190. border-color: $-button-info-plain-border-color;
  191. }
  192. @include when(warning) {
  193. color: $-button-warning-bg-color;
  194. }
  195. @include when(error) {
  196. color: $-button-error-bg-color;
  197. }
  198. }
  199. @include when(hairline) {
  200. border-width: 0;
  201. &.is-plain {
  202. @include halfPixelBorderSurround();
  203. &::before {
  204. border-radius: inherit;
  205. }
  206. &::after {
  207. border-color: inherit;
  208. }
  209. &.is-round {
  210. &::after {
  211. border-radius: inherit !important;
  212. }
  213. }
  214. &.is-large {
  215. &::after {
  216. border-radius: calc(2 * $-button-large-radius);
  217. }
  218. }
  219. &.is-medium {
  220. &::after {
  221. border-radius: calc(2 * $-button-medium-radius);
  222. }
  223. }
  224. &.is-small {
  225. &::after {
  226. border-radius: calc(2 * $-button-small-radius);
  227. }
  228. }
  229. }
  230. }
  231. @include when(block) {
  232. display: block;
  233. }
  234. @include when(icon) {
  235. width: $-button-icon-size;
  236. height: $-button-icon-size;
  237. padding: 0;
  238. border-radius: 50%;
  239. color: $-button-icon-color;
  240. &::after {
  241. display: none;
  242. }
  243. :deep(.wd-button__icon) {
  244. margin-right: 0;
  245. }
  246. @include when(disabled) {
  247. color: $-button-icon-disabled-color;
  248. background: transparent;
  249. }
  250. }
  251. @include edeep(icon) {
  252. display: block;
  253. margin-right: 6px;
  254. font-size: $-button-icon-fs;
  255. vertical-align: middle;
  256. }
  257. @include e(text) {
  258. user-select: none;
  259. white-space: nowrap;
  260. }
  261. }
  262. @keyframes wd-rotate {
  263. from {
  264. transform: rotate(0deg);
  265. }
  266. to {
  267. transform: rotate(360deg);
  268. }
  269. }