2ebdb2c91f945992e06615d33649fe2935827d33eba5d780c032020a3834e236168998b1d2ec7a55d5d9d87d9a0f6402a358d9087c1b78d231957bfc9fd089 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. @import "mixins/mixins";
  2. @import "common/var";
  3. @import "input";
  4. @include b(input-number) {
  5. position: relative;
  6. display: inline-block;
  7. width: 180px;
  8. line-height: #{$--input-height - 2};
  9. .el-input {
  10. display: block;
  11. &__inner {
  12. -webkit-appearance: none;
  13. padding-left: #{$--input-height + 10};
  14. padding-right: #{$--input-height + 10};
  15. text-align: center;
  16. }
  17. }
  18. @include e((increase, decrease)) {
  19. position: absolute;
  20. z-index: 1;
  21. top: 1px;
  22. width: $--input-height;
  23. height: auto;
  24. text-align: center;
  25. background: $--background-color-base;
  26. color: $--color-text-regular;
  27. cursor: pointer;
  28. font-size: 13px;
  29. &:hover {
  30. color: $--color-primary;
  31. &:not(.is-disabled) ~ .el-input .el-input__inner:not(.is-disabled) {
  32. border-color: $--input-focus-border;
  33. }
  34. }
  35. &.is-disabled {
  36. color: $--disabled-color-base;
  37. cursor: not-allowed;
  38. }
  39. }
  40. @include e(increase) {
  41. right: 1px;
  42. border-radius: 0 $--border-radius-base $--border-radius-base 0;
  43. border-left: $--border-base;
  44. }
  45. @include e(decrease) {
  46. left: 1px;
  47. border-radius: $--border-radius-base 0 0 $--border-radius-base;
  48. border-right: $--border-base;
  49. }
  50. @include when(disabled) {
  51. @include e((increase, decrease)) {
  52. border-color: $--disabled-border-base;
  53. color: $--disabled-border-base;
  54. &:hover {
  55. color: $--disabled-border-base;
  56. cursor: not-allowed;
  57. }
  58. }
  59. }
  60. @include m(medium) {
  61. width: 200px;
  62. line-height: #{$--input-medium-height - 2};
  63. @include e((increase, decrease)) {
  64. width: $--input-medium-height;
  65. font-size: $--input-medium-font-size;
  66. }
  67. .el-input__inner {
  68. padding-left: #{$--input-medium-height + 7};
  69. padding-right: #{$--input-medium-height + 7};
  70. }
  71. }
  72. @include m(small) {
  73. width: 130px;
  74. line-height: #{$--input-small-height - 2};
  75. @include e((increase, decrease)) {
  76. width: $--input-small-height;
  77. font-size: $--input-small-font-size;
  78. [class*=el-icon] {
  79. transform: scale(.9);
  80. }
  81. }
  82. .el-input__inner {
  83. padding-left: #{$--input-small-height + 7};
  84. padding-right: #{$--input-small-height + 7};
  85. }
  86. }
  87. @include m(mini) {
  88. width: 130px;
  89. line-height: #{$--input-mini-height - 2};
  90. @include e((increase, decrease)) {
  91. width: $--input-mini-height;
  92. font-size: $--input-mini-font-size;
  93. [class*=el-icon] {
  94. transform: scale(.8);
  95. }
  96. }
  97. .el-input__inner {
  98. padding-left: #{$--input-mini-height + 7};
  99. padding-right: #{$--input-mini-height + 7};
  100. }
  101. }
  102. @include when(without-controls) {
  103. .el-input__inner {
  104. padding-left: 15px;
  105. padding-right: 15px;
  106. }
  107. }
  108. @include when(controls-right) {
  109. .el-input__inner {
  110. padding-left: 15px;
  111. padding-right: #{$--input-height + 10};
  112. }
  113. @include e((increase, decrease)) {
  114. height: auto;
  115. line-height: #{($--input-height - 2) / 2};
  116. [class*=el-icon] {
  117. transform: scale(.8);
  118. }
  119. }
  120. @include e(increase) {
  121. border-radius: 0 $--border-radius-base 0 0;
  122. border-bottom: $--border-base;
  123. }
  124. @include e(decrease) {
  125. right: 1px;
  126. bottom: 1px;
  127. top: auto;
  128. left: auto;
  129. border-right: none;
  130. border-left: $--border-base;
  131. border-radius: 0 0 $--border-radius-base 0;
  132. }
  133. &[class*=medium] {
  134. [class*=increase], [class*=decrease] {
  135. line-height: #{($--input-medium-height - 2) / 2};
  136. }
  137. }
  138. &[class*=small] {
  139. [class*=increase], [class*=decrease] {
  140. line-height: #{($--input-small-height - 2) / 2};
  141. }
  142. }
  143. &[class*=mini] {
  144. [class*=increase], [class*=decrease] {
  145. line-height: #{($--input-mini-height - 2) / 2};
  146. }
  147. }
  148. }
  149. }