index.less 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. @import "../styles/mixins/index.less";
  2. @import "../styles/themes/index.less";
  3. .button(@theme, @bg-color, @border-color, @active-bg-color, @color) {
  4. &--@{theme},
  5. &--@{theme}--disabled {
  6. .button-style(@bg-color, @border-color, @color);
  7. }
  8. &--@{theme}&--hover {
  9. .button-hover(@active-bg-color, @color);
  10. }
  11. &--@{theme}&--outline,
  12. &--@{theme}&--outline&--disabled {
  13. .button-outline(@bg-color);
  14. }
  15. &--@{theme}&--outline&--hover {
  16. .button-hover(@bg-color, #fff);
  17. }
  18. &--@{theme}&--clear,
  19. &--@{theme}&--clear&--disabled {
  20. .button-clear(@active-bg-color);
  21. }
  22. &--@{theme}&--clear&--hover {
  23. opacity: @button-opacity-hover !important;
  24. }
  25. }
  26. .@{wux-prefix}-button {
  27. .button-reset();
  28. position: relative;
  29. display: inline-block;
  30. // margin-left: auto;
  31. // margin-right: auto;
  32. // padding-left: 14px;
  33. // padding-right: 14px;
  34. box-sizing: border-box;
  35. // font-size: 18px;
  36. // text-align: center;
  37. // text-decoration: none;
  38. // line-height: 2.55555556;
  39. // border-radius: 5px;
  40. // -webkit-tap-highlight-color: transparent;
  41. // overflow: hidden;
  42. // color: #000000;
  43. // background-color: #F8F8F8;
  44. margin: 0;
  45. padding: 0 @button-padding-base;
  46. min-width: (@button-padding-base * 3) + @button-font-size-base;
  47. min-height: @button-height-base !important;
  48. border: none;
  49. border-radius: @button-border-radius;
  50. vertical-align: middle;
  51. text-align: center;
  52. text-overflow: ellipsis;
  53. font-size: @button-font-size-base;
  54. line-height: @button-height-base - 2px;
  55. cursor: pointer;
  56. &::after {
  57. content: " ";
  58. width: 100%;
  59. height: 100%;
  60. position: absolute;
  61. top: -6px;
  62. right: -6px;
  63. bottom: -6px;
  64. left: -6px;
  65. border: none;
  66. transform: none;
  67. transform-origin: 0 0;
  68. box-sizing: border-box;
  69. border-radius: 0;
  70. }
  71. &--bordered {
  72. border: 1px solid transparent;
  73. }
  74. &--disabled {
  75. opacity: @button-opacity-disabled !important;
  76. }
  77. &--small {
  78. padding: 2px @button-padding-sm 1px;
  79. min-width: @button-height-sm - 2px;
  80. min-height: @button-height-sm !important;
  81. font-size: @button-font-size-sm;
  82. line-height: @button-height-sm - 4px;
  83. }
  84. &--large {
  85. padding: 0 @button-padding-lg;
  86. min-width: (@button-padding-lg * 3) + @button-font-size-lg;
  87. min-height: @button-height-lg !important;
  88. font-size: @button-font-size-lg;
  89. line-height: @button-height-lg - 6px;
  90. }
  91. &--block,
  92. &--full {
  93. width: 100% !important;
  94. margin-top: @button-block-margin;
  95. margin-bottom: @button-block-margin;
  96. }
  97. &--block {
  98. display: block;
  99. clear: both;
  100. &::after {
  101. clear: both;
  102. }
  103. }
  104. &--full {
  105. display: block;
  106. margin-right: 0 !important;
  107. margin-left: 0 !important;
  108. }
  109. &--full:not(&--rounded) {
  110. border-right-width: 0;
  111. border-left-width: 0;
  112. border-radius: 0;
  113. }
  114. &--rounded {
  115. border-radius: @button-height-lg;
  116. }
  117. &--rectangular {
  118. border-radius: 0;
  119. }
  120. &--outline&--hover {
  121. color: #fff !important;
  122. }
  123. .button(light, @button-light-bg, @button-default-border, @button-light-active-bg, @button-light-text);
  124. .button(stable, @button-stable-bg, @button-default-border, @button-stable-active-bg, @button-stable-text);
  125. .button(positive, @button-positive-bg, @button-default-border, @button-positive-active-bg, @button-positive-text);
  126. .button(calm, @button-calm-bg, @button-default-border, @button-calm-active-bg, @button-calm-text);
  127. .button(assertive, @button-assertive-bg, @button-default-border, @button-assertive-active-bg, @button-assertive-text);
  128. .button(balanced, @button-balanced-bg, @button-default-border, @button-balanced-active-bg, @button-balanced-text);
  129. .button(energized, @button-energized-bg, @button-default-border, @button-energized-active-bg, @button-energized-text);
  130. .button(royal, @button-royal-bg, @button-default-border, @button-royal-active-bg, @button-royal-text);
  131. .button(dark, @button-dark-bg, @button-default-border, @button-dark-active-bg, @button-dark-text);
  132. &--light&--outline {
  133. .button-outline(@button-light-border);
  134. }
  135. &--light&--outline&--hover {
  136. .button-hover(@button-light-border, #fff);
  137. }
  138. &--stable&--outline {
  139. .button-outline(@button-stable-border);
  140. }
  141. &--stable&--outline&--hover {
  142. .button-hover(@button-stable-border, #fff);
  143. }
  144. }