button.css 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. uni-button {
  2. position: relative;
  3. display: block;
  4. margin-left: auto;
  5. margin-right: auto;
  6. padding-left: 14px;
  7. padding-right: 14px;
  8. box-sizing: border-box;
  9. font-size: 18px;
  10. text-align: center;
  11. text-decoration: none;
  12. line-height: 2.55555556;
  13. border-radius: 5px;
  14. -webkit-tap-highlight-color: transparent;
  15. color: #000000;
  16. background-color: #f8f8f8;
  17. cursor: pointer;
  18. }
  19. uni-button[hidden] {
  20. display: none !important;
  21. }
  22. uni-button:after {
  23. content: ' ';
  24. width: 200%;
  25. height: 200%;
  26. position: absolute;
  27. top: 0;
  28. left: 0;
  29. border: 1px solid rgba(0, 0, 0, 0.2);
  30. transform: scale(0.5);
  31. transform-origin: 0 0;
  32. box-sizing: border-box;
  33. border-radius: 10px;
  34. }
  35. uni-button[native] {
  36. padding-left: 0;
  37. padding-right: 0;
  38. }
  39. uni-button[native] .uni-button-cover-view-wrapper {
  40. border: inherit;
  41. border-color: inherit;
  42. border-radius: inherit;
  43. background-color: inherit;
  44. }
  45. uni-button[native] .uni-button-cover-view-inner {
  46. padding-left: 14px;
  47. padding-right: 14px;
  48. }
  49. uni-button uni-cover-view {
  50. line-height: inherit;
  51. white-space: inherit;
  52. }
  53. uni-button[type='default'] {
  54. color: #000000;
  55. background-color: #f8f8f8;
  56. }
  57. uni-button[type='primary'] {
  58. color: #ffffff;
  59. background-color: #007aff;
  60. }
  61. uni-button[type='warn'] {
  62. color: #ffffff;
  63. background-color: #e64340;
  64. }
  65. uni-button[disabled] {
  66. color: rgba(255, 255, 255, 0.6);
  67. cursor: not-allowed;
  68. }
  69. uni-button[disabled][type='default'],
  70. uni-button[disabled]:not([type]) {
  71. color: rgba(0, 0, 0, 0.3);
  72. background-color: #f7f7f7;
  73. }
  74. uni-button[disabled][type='primary'] {
  75. background-color: rgba(0, 122, 255, 0.6);
  76. }
  77. uni-button[disabled][type='warn'] {
  78. background-color: #ec8b89;
  79. }
  80. uni-button[type='primary'][plain] {
  81. color: #007aff;
  82. background-color: transparent;
  83. }
  84. uni-button[type='primary'][plain][disabled] {
  85. color: rgba(0, 0, 0, 0.2);
  86. }
  87. uni-button[type='primary'][plain]:after {
  88. border-color:#007aff;
  89. }
  90. uni-button[type='default'][plain] {
  91. color: #353535;
  92. background-color: transparent;
  93. }
  94. uni-button[type='default'][plain][disabled] {
  95. color: rgba(0, 0, 0, 0.2);
  96. }
  97. uni-button[type='default'][plain]:after {
  98. border-color: #353535;
  99. }
  100. uni-button[plain][native] .uni-button-cover-view-inner {
  101. padding: 0;
  102. }
  103. uni-button[type='warn'][plain] {
  104. color: #e64340;
  105. background-color: transparent;
  106. }
  107. uni-button[type='warn'][plain][disabled] {
  108. color: rgba(0, 0, 0, 0.2);
  109. }
  110. uni-button[type='warn'][plain]:after {
  111. border-color: #e64340;
  112. }
  113. uni-button[plain] {
  114. color: #353535;
  115. background-color: transparent;
  116. }
  117. uni-button[plain][disabled] {
  118. color: rgba(0, 0, 0, 0.2);
  119. }
  120. uni-button[plain]:after {
  121. border-color: #353535;
  122. }
  123. uni-button[plain][disabled]:after {
  124. border-color: rgba(0, 0, 0, 0.2);
  125. }
  126. uni-button[size='mini'] {
  127. display: inline-block;
  128. line-height: 2.3;
  129. font-size: 13px;
  130. padding: 0 1.34em;
  131. }
  132. uni-button[size='mini'][native] {
  133. padding: 0;
  134. }
  135. uni-button[size='mini'][native] .uni-button-cover-view-inner {
  136. padding: 0 1.34em;
  137. }
  138. uni-button[loading]:not([disabled]) {
  139. cursor: progress;
  140. }
  141. uni-button[loading]:before {
  142. content: ' ';
  143. display: inline-block;
  144. width: 18px;
  145. height: 18px;
  146. vertical-align: middle;
  147. animation: uni-loading 1s steps(12, end) infinite;
  148. background-size: 100%;
  149. }
  150. uni-button[loading][type='primary'] {
  151. color: rgba(255, 255, 255, 0.6);
  152. background-color: #0062cc;
  153. }
  154. uni-button[loading][type='primary'][plain] {
  155. color: #007aff;
  156. background-color: transparent;
  157. }
  158. uni-button[loading][type='default'] {
  159. color: rgba(0, 0, 0, 0.6);
  160. background-color: #dedede;
  161. }
  162. uni-button[loading][type='default'][plain] {
  163. color: #353535;
  164. background-color: transparent;
  165. }
  166. uni-button[loading][type='warn'] {
  167. color: rgba(255, 255, 255, 0.6);
  168. background-color: #ce3c39;
  169. }
  170. uni-button[loading][type='warn'][plain] {
  171. color: #e64340;
  172. background-color: transparent;
  173. }
  174. uni-button[loading][native]:before {
  175. content: none;
  176. }
  177. .button-hover {
  178. color: rgba(0, 0, 0, 0.6);
  179. background-color: #dedede;
  180. }
  181. .button-hover[plain] {
  182. color: rgba(53, 53, 53, 0.6);
  183. background-color: transparent;
  184. }
  185. .button-hover[plain]:after {
  186. border-color: rgba(53, 53, 53, 0.6);
  187. }
  188. .button-hover[type='primary'] {
  189. color: rgba(255, 255, 255, 0.6);
  190. background-color: #0062cc;
  191. }
  192. .button-hover[type='primary'][plain] {
  193. color: rgba(0, 122, 255, 0.6);
  194. background-color: transparent;
  195. }
  196. .button-hover[type='primary'][plain]:after {
  197. border-color: rgba(0, 122, 255, 0.6);
  198. }
  199. .button-hover[type='default'] {
  200. color: rgba(0, 0, 0, 0.6);
  201. background-color: #dedede;
  202. }
  203. .button-hover[type='default'][plain] {
  204. color: rgba(53, 53, 53, 0.6);
  205. background-color: transparent;
  206. }
  207. .button-hover[type='default'][plain]:after {
  208. border-color: rgba(53, 53, 53, 0.6);
  209. }
  210. .button-hover[type='warn'] {
  211. color: rgba(255, 255, 255, 0.6);
  212. background-color: #ce3c39;
  213. }
  214. .button-hover[type='warn'][plain] {
  215. color: rgba(230, 67, 64, 0.6);
  216. background-color: transparent;
  217. }
  218. .button-hover[type='warn'][plain]:after {
  219. border-color: rgba(230, 67, 64, 0.6);
  220. }
  221. @media (prefers-color-scheme: dark) {
  222. uni-button,
  223. uni-button[type='default'] {
  224. color: #d6d6d6;
  225. background-color: #343434;
  226. }
  227. .button-hover,
  228. .button-hover[type='default'] {
  229. color: #d6d6d6;
  230. background-color: rgba(255, 255, 255, 0.1);
  231. }
  232. uni-button[disabled][type='default'],
  233. uni-button[disabled]:not([type]) {
  234. color: rgba(255, 255, 255, 0.2);
  235. background-color: rgba(255, 255, 255, 0.08);
  236. }
  237. uni-button[type='primary'][plain][disabled] {
  238. color: rgba(255, 255, 255, 0.2);
  239. border-color: rgba(255, 255, 255, 0.2);
  240. }
  241. uni-button[type='default'][plain] {
  242. color: #d6d6d6;
  243. }
  244. uni-button[type='default'][plain]:after {
  245. border-color: #d6d6d6;
  246. }
  247. .button-hover[type='default'][plain] {
  248. color: rgba(150, 150, 150, 0.6);
  249. border-color: rgba(150, 150, 150, 0.6);
  250. background-color: rgba(50, 50, 50, 0.2);
  251. }
  252. .button-hover[type='default'][plain]:after {
  253. border-color: rgba(150, 150, 150, 0.6);
  254. }
  255. uni-button[type='default'][plain][disabled] {
  256. color: hsla(0, 0%, 100%, 0.2);
  257. }
  258. uni-button[type='default'][plain][disabled]:after {
  259. border-color: hsla(0, 0%, 100%, 0.2);
  260. }
  261. }