input-number.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. @import '../common/base.scss';
  2. .m-input-number{
  3. position: relative;
  4. display: inline-block;
  5. width: 180px;
  6. line-height: 38px;
  7. &:hover{
  8. border-color: $primary;
  9. }
  10. .m-input-number__decrease,
  11. .m-input-number__increase{
  12. position: absolute;
  13. z-index: 1;
  14. top: 1px;
  15. width: 40px;
  16. height: auto;
  17. text-align: center;
  18. background: #f5f7fa;
  19. color: #606266;
  20. cursor: pointer;
  21. font-size: 13px;
  22. }
  23. .m-input-number__decrease{
  24. left: 1px;
  25. border-radius: 4px 0 0 4px;
  26. border-right: 1px solid #dcdfe6;
  27. }
  28. .m-input-number__increase{
  29. right: 1px;
  30. border-radius: 0 4px 4px 0;
  31. border-left: 1px solid #dcdfe6;
  32. }
  33. .m-input__inner{
  34. background-color: #fff;
  35. background-image: none;
  36. border-radius: 4px;
  37. border: 1px solid #dcdfe6;
  38. box-sizing: border-box;
  39. color: #606266;
  40. display: inline-block;
  41. font-size: inherit;
  42. height: 40px;
  43. line-height: 40px;
  44. outline: none;
  45. padding: 0 15px;
  46. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  47. width: 100%;
  48. padding-left: 50px;
  49. padding-right: 50px;
  50. text-align: center;
  51. &:focus{
  52. border-color: $primary;
  53. }
  54. }
  55. .is-disabled{
  56. cursor: not-allowed;
  57. }
  58. }
  59. .is-disabled{
  60. cursor: not-allowed;
  61. .m-input-number__decrease,
  62. .m-input-number__increase{
  63. border-color: #e4e7ed;
  64. color: #e4e7ed;
  65. }
  66. .m-input__inner{
  67. background-color: #f5f7fa;
  68. border-color: #e4e7ed;
  69. color: #c0c4cc;
  70. cursor: not-allowed;
  71. }
  72. }
  73. .is-controls-right{
  74. .m-input-number__decrease{
  75. right: 1px;
  76. bottom: 1px;
  77. top: auto;
  78. left: auto;
  79. border-right: none;
  80. border-left: 1px solid #dcdfe6;
  81. border-radius: 0 0 4px 0;
  82. height: 19px;
  83. line-height: 19px;
  84. }
  85. .m-input-number__increase{
  86. height: 19px;
  87. line-height: 19px;
  88. border-bottom: 1px solid #dcdfe6;
  89. }
  90. .m-input__inner{
  91. padding-left: 15px;
  92. padding-right: 50px;
  93. }
  94. &.m-input-number--medium{
  95. .m-input-number__decrease{
  96. height: 17px;
  97. line-height: 17px;
  98. }
  99. .m-input-number__increase{
  100. height: 17px;
  101. line-height: 17px;
  102. }
  103. }
  104. &.m-input-number--small{
  105. .m-input-number__decrease{
  106. height: 14px;
  107. line-height: 14px;
  108. }
  109. .m-input-number__increase{
  110. height: 14px;
  111. line-height: 14px;
  112. }
  113. }
  114. }
  115. .m-input-number__decrease.is-disabled,
  116. .m-input-number__increase.is-disabled{
  117. border-color: #e4e7ed;
  118. color: #c0c4cc;
  119. }
  120. .m-input-number--medium{
  121. width: 150px;
  122. line-height: 32px;
  123. .m-input__inner{
  124. width: 150px;
  125. height: 34px;
  126. }
  127. }
  128. .m-input-number--small{
  129. width: 130px;
  130. line-height: 28px;
  131. .m-input__inner{
  132. width: 130px;
  133. height: 30px;
  134. }
  135. }