index.scss 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. @import "./../common/abstracts/_mixin.scss";
  2. @import "./../common/abstracts/variable.scss";
  3. .wot-theme-dark {
  4. @include b(checkbox) {
  5. @include e(shape) {
  6. background: transparent;
  7. border-color: $-checkbox-border-color;
  8. color: $-checkbox-check-color;
  9. }
  10. @include e(label) {
  11. color: $-dark-color;
  12. }
  13. @include when(disabled) {
  14. .wd-checkbox__shape {
  15. border-color: $-dark-color-gray;
  16. background: $-dark-background4;
  17. }
  18. .wd-checkbox__label {
  19. color: $-dark-color-gray;
  20. }
  21. :deep(.wd-checkbox__check) {
  22. color: $-dark-color-gray;
  23. }
  24. @include when(checked) {
  25. .wd-checkbox__shape {
  26. color: $-dark-color-gray;
  27. }
  28. .wd-checkbox__label {
  29. color: $-dark-color-gray;
  30. }
  31. }
  32. @include when(button) {
  33. .wd-checkbox__label {
  34. border-color: #c8c9cc;
  35. background: #3a3a3c;
  36. color: $-dark-color-gray;
  37. }
  38. @include when(checked) {
  39. .wd-checkbox__label {
  40. border-color: #c8c9cc;
  41. background: #3a3a3c;
  42. color: #c8c9cc;
  43. }
  44. }
  45. }
  46. }
  47. @include when(button) {
  48. .wd-checkbox__label {
  49. background-color: $-dark-background;
  50. }
  51. @include when(checked) {
  52. .wd-checkbox__label {
  53. background-color: $-dark-background2;
  54. }
  55. }
  56. }
  57. }
  58. }
  59. @include b(checkbox) {
  60. display: block;
  61. margin-bottom: $-checkbox-margin;
  62. font-size: 0;
  63. -webkit-tap-highlight-color: transparent;
  64. line-height: 1.2;
  65. @include when(last-child) {
  66. margin-bottom: 0;
  67. }
  68. @include e(shape) {
  69. position: relative;
  70. display: inline-block;
  71. width: $-checkbox-size;
  72. height: $-checkbox-size;
  73. border: 2px solid $-checkbox-border-color;
  74. border-radius: 50%;
  75. color: $-checkbox-check-color;
  76. background: $-checkbox-bg;
  77. vertical-align: middle;
  78. transition: background 0.2s;
  79. box-sizing: border-box;
  80. @include when(square) {
  81. border-radius: $-checkbox-square-radius;
  82. }
  83. }
  84. @include e(input) {
  85. position: absolute;
  86. width: 0;
  87. height: 0;
  88. margin: 0;
  89. opacity: 0;
  90. }
  91. @include edeep(btn-check) {
  92. display: inline-block;
  93. font-size: $-checkbox-icon-size;
  94. margin-right: 4px;
  95. vertical-align: middle;
  96. }
  97. @include e(txt) {
  98. display: inline-block;
  99. vertical-align: middle;
  100. line-height: 20px;
  101. @include lineEllipsis;
  102. }
  103. @include e(label) {
  104. position: relative;
  105. display: inline-block;
  106. margin-left: $-checkbox-label-margin;
  107. vertical-align: middle;
  108. font-size: $-checkbox-label-fs;
  109. color: $-checkbox-label-color;
  110. }
  111. @include edeep(check) {
  112. color: $-checkbox-check-color;
  113. font-size: $-checkbox-icon-size;
  114. opacity: 0;
  115. transition: opacity 0.2s;
  116. }
  117. @include when(checked) {
  118. .wd-checkbox__shape {
  119. color: $-checkbox-checked-color;
  120. background: currentColor;
  121. border-color: currentColor;
  122. }
  123. :deep(.wd-checkbox__check) {
  124. opacity: 1;
  125. position: absolute;
  126. left: 50%;
  127. top: 50%;
  128. transform: translate(-50%, -50%);
  129. }
  130. }
  131. @include when(button) {
  132. display: inline-block;
  133. margin-bottom: 0;
  134. margin-right: $-checkbox-margin;
  135. vertical-align: top;
  136. font-size: $-checkbox-button-font-size;
  137. @include when(last-child) {
  138. margin-right: 0;
  139. }
  140. .wd-checkbox__shape {
  141. width: 0;
  142. height: 0;
  143. overflow: hidden;
  144. opacity: 0;
  145. border: none;
  146. }
  147. .wd-checkbox__label {
  148. display: inline-flex;
  149. flex-direction: row;
  150. justify-content: center;
  151. align-items: center;
  152. min-width: $-checkbox-button-min-width;
  153. height: $-checkbox-button-height;
  154. font-size: $-checkbox-button-font-size;
  155. margin-left: 0;
  156. padding: 5px 15px;
  157. border: 1px solid $-checkbox-button-border;
  158. background-color: $-checkbox-button-bg;
  159. border-radius: $-checkbox-button-radius;
  160. transition: color 0.2s, border 0.2s;
  161. box-sizing: border-box;
  162. }
  163. @include when(checked) {
  164. .wd-checkbox__label {
  165. color: $-checkbox-checked-color;
  166. background-color: $-checkbox-bg;
  167. border-color: $-checkbox-checked-color;
  168. border-color: currentColor;
  169. }
  170. }
  171. }
  172. @include when(inline) {
  173. display: inline-block;
  174. margin-bottom: 0;
  175. margin-right: $-checkbox-margin;
  176. @include when(last-child) {
  177. margin-right: 0;
  178. }
  179. }
  180. @include when(disabled) {
  181. .wd-checkbox__shape {
  182. border-color: $-checkbox-border-color;
  183. background: $-checkbox-disabled-check-bg;
  184. }
  185. .wd-checkbox__label {
  186. color: $-checkbox-disabled-label-color;
  187. }
  188. @include when(checked) {
  189. .wd-checkbox__shape {
  190. color: $-checkbox-disabled-check-color;
  191. }
  192. .wd-checkbox__label {
  193. color: $-checkbox-disabled-label-color;
  194. }
  195. }
  196. @include when(button) {
  197. .wd-checkbox__label {
  198. background: $-checkbox-disabled-color;
  199. border-color: $-checkbox-button-border;
  200. color: $-checkbox-disabled-label-color;
  201. }
  202. @include when(checked) {
  203. .wd-checkbox__label {
  204. border-color: $-checkbox-button-disabled-border;
  205. }
  206. }
  207. }
  208. }
  209. // 以下内容用于解决父子组件样式隔离的问题 —— START
  210. @include when(cell-box) {
  211. padding: 13px 15px;
  212. margin: 0;
  213. @include when(large) {
  214. padding: 14px 15px;
  215. }
  216. }
  217. @include when(button-box) {
  218. display: inline-flex;
  219. width: 33.3333%;
  220. padding: 12px 12px 0 0;
  221. box-sizing: border-box;
  222. .wd-checkbox__label {
  223. width: 100%;
  224. }
  225. &:last-child::after {
  226. content: "";
  227. display: table;
  228. clear: both;
  229. }
  230. }
  231. @include when(large) {
  232. .wd-checkbox__shape {
  233. width: $-checkbox-large-size;
  234. height: $-checkbox-large-size;
  235. font-size: $-checkbox-large-size;
  236. }
  237. .wd-checkbox__label {
  238. font-size: $-checkbox-large-label-fs;
  239. }
  240. }
  241. }