index-pure.less 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @import '../../input/style/mixin';
  4. @import './affix';
  5. @input-number-prefix-cls: ~'@{ant-prefix}-input-number';
  6. @form-item-prefix-cls: ~'@{ant-prefix}-form-item';
  7. .@{input-number-prefix-cls} {
  8. .reset-component();
  9. .input();
  10. //== Style for input-group: input with label, with button or dropdown...
  11. &-group {
  12. .reset-component();
  13. .input-group(~'@{input-number-prefix-cls}');
  14. &-wrapper {
  15. display: inline-block;
  16. text-align: start;
  17. vertical-align: top; // https://github.com/ant-design/ant-design/issues/6403
  18. }
  19. }
  20. display: inline-block;
  21. width: 90px;
  22. margin: 0;
  23. padding: 0;
  24. border: @border-width-base @border-style-base @border-color-base;
  25. border-radius: @border-radius-base;
  26. &-handler {
  27. position: relative;
  28. display: block;
  29. width: 100%;
  30. height: 50%;
  31. overflow: hidden;
  32. color: @text-color-secondary;
  33. font-weight: bold;
  34. line-height: 0;
  35. text-align: center;
  36. border-left: @border-width-base @border-style-base @input-number-handler-border-color;
  37. transition: all 0.1s linear;
  38. &:active {
  39. background: @input-number-handler-active-bg;
  40. }
  41. &:hover &-up-inner,
  42. &:hover &-down-inner {
  43. color: @input-number-handler-hover-bg;
  44. }
  45. }
  46. &-handler-up-inner,
  47. &-handler-down-inner {
  48. .iconfont-mixin();
  49. position: absolute;
  50. right: 4px;
  51. width: 12px;
  52. height: 12px;
  53. color: @text-color-secondary;
  54. line-height: 12px;
  55. transition: all 0.1s linear;
  56. user-select: none;
  57. }
  58. &:hover {
  59. .hover(@input-number-hover-border-color);
  60. & + .@{form-item-prefix-cls}-children-icon {
  61. opacity: 0;
  62. transition: opacity 0.24s linear 0.24s;
  63. }
  64. }
  65. &-focused {
  66. .active();
  67. }
  68. &-disabled {
  69. .disabled();
  70. .@{input-number-prefix-cls}-input {
  71. cursor: not-allowed;
  72. }
  73. .@{input-number-prefix-cls}-handler-wrap {
  74. display: none;
  75. }
  76. }
  77. &-readonly {
  78. .@{input-number-prefix-cls}-handler-wrap {
  79. display: none;
  80. }
  81. }
  82. &-input {
  83. width: 100%;
  84. height: @input-height-base - 2px;
  85. padding: 0 @control-padding-horizontal - 1px;
  86. text-align: left;
  87. background-color: transparent;
  88. border: 0;
  89. border-radius: @border-radius-base;
  90. outline: 0;
  91. transition: all 0.3s linear;
  92. appearance: textfield !important;
  93. .placeholder();
  94. &[type='number']::-webkit-inner-spin-button,
  95. &[type='number']::-webkit-outer-spin-button {
  96. margin: 0;
  97. /* stylelint-disable-next-line property-no-vendor-prefix */
  98. -webkit-appearance: none;
  99. appearance: none;
  100. }
  101. }
  102. &-lg {
  103. padding: 0;
  104. font-size: @font-size-lg;
  105. input {
  106. height: @input-height-lg - 2px;
  107. }
  108. }
  109. &-sm {
  110. padding: 0;
  111. input {
  112. height: @input-height-sm - 2px;
  113. padding: 0 @control-padding-horizontal-sm - 1px;
  114. }
  115. }
  116. &-handler-wrap {
  117. position: absolute;
  118. top: 0;
  119. right: 0;
  120. width: 22px;
  121. height: 100%;
  122. background: @input-number-handler-bg;
  123. border-radius: 0 @border-radius-base @border-radius-base 0;
  124. opacity: 0;
  125. transition: opacity 0.24s linear 0.1s;
  126. // Fix input number inside Menu makes icon too large
  127. // We arise the selector priority by nest selector here
  128. // https://github.com/ant-design/ant-design/issues/14367
  129. .@{input-number-prefix-cls}-handler {
  130. .@{input-number-prefix-cls}-handler-up-inner,
  131. .@{input-number-prefix-cls}-handler-down-inner {
  132. display: flex;
  133. align-items: center;
  134. justify-content: center;
  135. min-width: auto;
  136. margin-right: 0;
  137. font-size: 7px;
  138. }
  139. }
  140. .@{input-number-prefix-cls}-borderless & {
  141. border-left-width: 0;
  142. }
  143. }
  144. &-handler-wrap:hover &-handler {
  145. height: 40%;
  146. }
  147. &:hover &-handler-wrap,
  148. &-focused &-handler-wrap {
  149. opacity: 1;
  150. }
  151. &-handler-up {
  152. border-top-right-radius: @border-radius-base;
  153. cursor: pointer;
  154. &-inner {
  155. top: 50%;
  156. margin-top: -5px;
  157. text-align: center;
  158. }
  159. &:hover {
  160. height: 60% !important;
  161. }
  162. }
  163. &-handler-down {
  164. top: 0;
  165. border-top: @border-width-base @border-style-base @border-color-base;
  166. border-bottom-right-radius: @border-radius-base;
  167. cursor: pointer;
  168. &-inner {
  169. top: 50%;
  170. text-align: center;
  171. transform: translateY(-50%);
  172. }
  173. &:hover {
  174. height: 60% !important;
  175. }
  176. .@{input-number-prefix-cls}-borderless & {
  177. border-top-width: 0;
  178. }
  179. }
  180. &-handler-up-disabled,
  181. &-handler-down-disabled {
  182. cursor: not-allowed;
  183. }
  184. &-handler-up-disabled:hover &-handler-up-inner,
  185. &-handler-down-disabled:hover &-handler-down-inner {
  186. color: @disabled-color;
  187. }
  188. &-borderless {
  189. box-shadow: none;
  190. }
  191. // ===================== Out Of Range =====================
  192. &-out-of-range {
  193. input {
  194. color: @error-color;
  195. }
  196. }
  197. }
  198. @import './rtl';