index.scss 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. @import "../common/abstracts/variable";
  2. @import "../common/abstracts/mixin";
  3. .wot-theme-dark {
  4. @include b(textarea) {
  5. background: $-dark-background2;
  6. &::after {
  7. background: $-dark-color-gray;
  8. }
  9. @include when(not-empty) {
  10. &:not(.is-disabled) {
  11. &::after {
  12. background-color: $-dark-color;
  13. }
  14. }
  15. }
  16. @include e(value) {
  17. background: $-dark-background2;
  18. }
  19. @include e(inner) {
  20. color: $-dark-color;
  21. &::-webkit-input-placeholder {
  22. color: $-dark-color3;
  23. }
  24. }
  25. @include e(count) {
  26. color: $-dark-color3;
  27. background: transparent;
  28. }
  29. @include e(count-current) {
  30. color: $-dark-color;
  31. }
  32. :deep(.wd-textarea__icon),
  33. :deep(.wd-textarea__clear) {
  34. color: $-dark-color;
  35. background: transparent;
  36. }
  37. @include when(cell) {
  38. background-color: $-dark-background2;
  39. @include when(border) {
  40. @include halfPixelBorder("top", $-textarea-cell-padding, $-dark-border-color);
  41. }
  42. }
  43. @include when(disabled) {
  44. .wd-textarea__inner {
  45. color: $-dark-color-gray;
  46. background: transparent;
  47. }
  48. }
  49. @include e(label) {
  50. color: $-dark-color;
  51. }
  52. }
  53. }
  54. @include b(textarea) {
  55. position: relative;
  56. -webkit-tap-highlight-color: transparent;
  57. text-align: left;
  58. background: $-textarea-bg;
  59. padding: $-textarea-cell-padding $-textarea-padding;
  60. &::after {
  61. position: absolute;
  62. display: none;
  63. content: "";
  64. bottom: 0;
  65. left: 0;
  66. right: 0;
  67. height: 1px;
  68. background: $-textarea-border-color;
  69. transform: scaleY(0.5);
  70. transition: background-color 0.2s ease-in-out;
  71. }
  72. @include e(label) {
  73. position: relative;
  74. display: flex;
  75. width: $-input-cell-label-width;
  76. color: $-cell-title-color;
  77. margin-right: $-cell-padding;
  78. box-sizing: border-box;
  79. font-size: $-textarea-fs;
  80. flex-shrink: 0;
  81. }
  82. @include e(label-inner) {
  83. display: inline-block;
  84. line-height: $-cell-line-height;
  85. font-size: $-textarea-fs;
  86. }
  87. @include e(required) {
  88. font-size: $-cell-required-size;
  89. color: $-cell-required-color;
  90. margin-left: $-cell-required-margin;
  91. @include m(left) {
  92. margin-left: 0;
  93. margin-right: $-cell-required-margin;
  94. }
  95. }
  96. @include e(prefix) {
  97. margin-right: $-textarea-icon-margin;
  98. font-size: $-textarea-fs;
  99. line-height: initial;
  100. :deep(.wd-textarea__icon) {
  101. margin-left: 0;
  102. }
  103. }
  104. @include e(suffix) {
  105. flex-shrink: 0;
  106. line-height: initial;
  107. }
  108. @include e(value) {
  109. position: relative;
  110. padding: 0;
  111. font-size: 0;
  112. background: $-textarea-bg;
  113. box-sizing: border-box;
  114. @include when(show-limit) {
  115. padding-bottom: 36px;
  116. }
  117. @include when(suffix) {
  118. padding-right: calc($-textarea-icon-size + 8px);
  119. }
  120. }
  121. @include e(inner) {
  122. padding: 0;
  123. width: 100%;
  124. font-size: $-textarea-fs;
  125. line-height: $-cell-line-height;
  126. color: $-textarea-color;
  127. outline: none;
  128. background: none;
  129. border: none;
  130. box-sizing: border-box;
  131. word-break: break-word;
  132. min-height: 24px;
  133. &::-webkit-input-placeholder {
  134. color: $-input-placeholder-color;
  135. }
  136. }
  137. @include e(suffix) {
  138. position: absolute;
  139. z-index: 1;
  140. right: 0;
  141. top: 0;
  142. bottom: 0;
  143. }
  144. @include edeep(icon) {
  145. margin-left: $-textarea-icon-margin;
  146. font-size: $-textarea-icon-size;
  147. color: $-textarea-icon-color;
  148. background: $-textarea-bg;
  149. }
  150. @include edeep(clear) {
  151. margin-left: $-textarea-icon-margin;
  152. font-size: $-textarea-icon-size;
  153. color: $-textarea-clear-color;
  154. vertical-align: middle;
  155. background: $-textarea-bg;
  156. line-height: $-cell-line-height;
  157. }
  158. @include e(count) {
  159. position: absolute;
  160. bottom: 8px;
  161. right: 0;
  162. font-size: $-textarea-count-fs;
  163. color: $-textarea-count-color;
  164. background: $-textarea-bg;
  165. line-height: 20px;
  166. display: inline-flex;
  167. }
  168. @include e(count-current) {
  169. color: $-textarea-count-current-color;
  170. @include when(error) {
  171. color: $-input-error-color;
  172. }
  173. }
  174. @include e(readonly-mask) {
  175. position: absolute;
  176. top: 0;
  177. left: 0;
  178. z-index: 2;
  179. width: 100%;
  180. height: 100%;
  181. }
  182. @include e(error-message) {
  183. color: $-form-item-error-message-color;
  184. font-size: $-form-item-error-message-font-size;
  185. line-height: $-form-item-error-message-line-height;
  186. text-align: left;
  187. vertical-align: middle;
  188. }
  189. @include when(not-empty) {
  190. &:not(.is-disabled) {
  191. &::after {
  192. background-color: $-textarea-not-empty-border-color;
  193. }
  194. }
  195. }
  196. @include when(disabled) {
  197. .wd-textarea__inner {
  198. color: $-input-disabled-color;
  199. background: transparent;
  200. }
  201. }
  202. @include when(error) {
  203. .wd-textarea__inner {
  204. color: $-input-error-color;
  205. background: transparent;
  206. }
  207. }
  208. @include when(auto-height) {
  209. &:not(.is-cell) {
  210. padding: 5px 0;
  211. }
  212. &::after {
  213. display: block;
  214. }
  215. }
  216. @include when(no-border) {
  217. &::after {
  218. display: none;
  219. }
  220. }
  221. @include when(cell) {
  222. display: flex;
  223. line-height: $-cell-line-height;
  224. &.is-error::after {
  225. background: $-textarea-cell-border-color;
  226. }
  227. .wd-textarea__value {
  228. flex: 1;
  229. }
  230. :deep(.wd-textarea__icon) {
  231. display: inline-flex;
  232. align-items: center;
  233. height: $-textarea-cell-height;
  234. line-height: $-textarea-cell-height;
  235. }
  236. .wd-textarea__prefix {
  237. display: inline-block;
  238. margin-right: $-cell-icon-right;
  239. }
  240. &.wd-textarea::after {
  241. display: none;
  242. }
  243. .wd-textarea__suffix {
  244. right: 0;
  245. }
  246. @include when(center) {
  247. align-items: center;
  248. }
  249. @include when(border) {
  250. @include halfPixelBorder("top", $-textarea-cell-padding);
  251. }
  252. }
  253. @include when(large) {
  254. padding: $-textarea-cell-padding-large;
  255. .wd-textarea__prefix {
  256. font-size: $-textarea-fs-large;
  257. }
  258. .wd-textarea__label-inner {
  259. font-size: $-textarea-fs-large;
  260. }
  261. .wd-textarea__inner {
  262. font-size: $-textarea-fs-large;
  263. }
  264. .wd-textarea__count {
  265. font-size: $-textarea-count-fs-large;
  266. }
  267. :deep(.wd-textarea__icon),
  268. :deep(.wd-textarea__clear) {
  269. font-size: $-textarea-icon-size-large;
  270. }
  271. }
  272. }