button.scss 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. @import '../common/base.scss';
  2. .m-button {
  3. display: inline-block;
  4. padding: 12px 20px;
  5. line-height: 1;
  6. border: 1px solid #d9d9d9;
  7. box-sizing: border-box;
  8. background: #fff;
  9. color: #333;
  10. white-space: nowrap;
  11. outline: none;
  12. font-size: 14px;
  13. cursor: pointer;
  14. }
  15. .m-button--default{
  16. border: 1px solid #d9d9d9;
  17. background: #fff;
  18. color: #333;
  19. &:hover {
  20. opacity: 0.8;
  21. border-color: $primary;
  22. color: $primary;
  23. }
  24. }
  25. .m-button--primary{
  26. color: #fff;
  27. background-color: $primary;
  28. border-color: $primary;
  29. &:hover {
  30. opacity: 0.8;
  31. color: #fff;
  32. }
  33. }
  34. .m-button--success {
  35. color: #fff;
  36. background-color: $success;
  37. border-color: $success;
  38. &:hover {
  39. opacity: 0.8;
  40. background-color: $success;
  41. color: #fff;
  42. }
  43. }
  44. .m-button--danger {
  45. color: #fff;
  46. background-color: $danger;
  47. border-color: $danger;
  48. &:hover {
  49. color: #fff;
  50. border-color: $danger;
  51. opacity: 0.8;
  52. }
  53. }
  54. .m-button--info {
  55. color: #fff;
  56. background-color: $info;
  57. border-color: $info;
  58. &:hover {
  59. color: #fff;
  60. border-color: $info;
  61. opacity: 0.8;
  62. }
  63. }
  64. .m-button--warning {
  65. color: #fff;
  66. background-color: $warning;
  67. border-color: $warning;
  68. &:hover {
  69. color: #fff;
  70. border-color: $warning;
  71. opacity: 0.8;
  72. }
  73. }
  74. .m-button--text {
  75. border-color: transparent;
  76. color: #409eff;
  77. background: transparent;
  78. padding-left: 0;
  79. padding-right: 0;
  80. &:hover {
  81. border-color: transparent;
  82. opacity: 0.8;
  83. }
  84. }
  85. // 禁止
  86. .is-disabled{
  87. color: #fff;
  88. cursor: not-allowed;
  89. background-color: #fff;
  90. border-color: #ebeef5;
  91. }
  92. .m-button--default.is-disabled{
  93. color: #c0c4cc;
  94. cursor: not-allowed;
  95. background-color: #fff;
  96. border-color: #ebeef5;
  97. }
  98. .m-button--primary.is-disabled{
  99. color: #fff;
  100. background-color: #a0cfff;
  101. border-color: #a0cfff;
  102. }
  103. .m-button--success.is-disabled{
  104. color: #fff;
  105. background-color: #b3e19d;
  106. border-color: #b3e19d;
  107. }
  108. .m-button--danger.is-disabled{
  109. color: #fff;
  110. background-color: #fab6b6;
  111. border-color: #fab6b6;
  112. }
  113. .m-button--info.is-disabled{
  114. color: #fff;
  115. background-color: #c8c9cc;
  116. border-color: #c8c9cc;
  117. }
  118. .m-button--warning.is-disabled{
  119. color: #fff;
  120. background-color: #f3d19e;
  121. border-color: #f3d19e;
  122. }
  123. .m-button--text.is-disabled{
  124. cursor: no-drop;
  125. color: #555;
  126. border: 1px solid #fff;
  127. background: none;
  128. opacity: .5;
  129. }
  130. // 圆角
  131. .is-round{
  132. border-radius: 20px;
  133. }
  134. // 圆
  135. .is-circle{
  136. border-radius: 50%;
  137. padding: 12px;
  138. }
  139. .noText{
  140. margin-left: 0 !important;
  141. margin-right: 0 !important;
  142. }
  143. .icon-loading{
  144. display: inline-block;
  145. margin-right: 4px;
  146. animation: rotating 2s linear infinite;
  147. -webkit-animation: rotating 2s linear infinite;
  148. }
  149. @keyframes rotating {
  150. 0% {
  151. transform: rotate(0deg);
  152. }
  153. 50% {
  154. transform: rotate(180deg);
  155. }
  156. 100% {
  157. transform: rotate(360deg);
  158. }
  159. }
  160. .m-button--medium{
  161. padding: 10px 20px;
  162. font-size: 14px;
  163. }
  164. .m-button--small{
  165. padding: 9px 15px;
  166. font-size: 12px;
  167. }
  168. .m-button--mini{
  169. padding: 7px 15px;
  170. font-size: 12px;
  171. }