buttons.css 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. /* ----------------------------------------------------------------------------
  2. NOTE: If you edit this file, you should make sure that the CSS rules for
  3. buttons in the following files are updated.
  4. * jquery-ui-dialog.css
  5. * editor.css
  6. WordPress-style Buttons
  7. =======================
  8. Create a button by adding the `.button` class to an element. For backward
  9. compatibility, we support several other classes (such as `.button-secondary`),
  10. but these will *not* work with the stackable classes described below.
  11. Button Styles
  12. -------------
  13. To display a primary button style, add the `.button-primary` class to a button.
  14. Button Sizes
  15. ------------
  16. Adjust a button's size by adding the `.button-large` or `.button-small` class.
  17. Button States
  18. -------------
  19. Lock the state of a button by adding the name of the pseudoclass as
  20. an actual class (e.g. `.hover` for `:hover`).
  21. TABLE OF CONTENTS:
  22. ------------------
  23. 1.0 - Button Layouts
  24. 2.0 - Default Button Style
  25. 3.0 - Primary Button Style
  26. 4.0 - Button Groups
  27. 5.0 - Responsive Button Styles
  28. ---------------------------------------------------------------------------- */
  29. /* ----------------------------------------------------------------------------
  30. 1.0 - Button Layouts
  31. ---------------------------------------------------------------------------- */
  32. .wp-core-ui .button,
  33. .wp-core-ui .button-primary,
  34. .wp-core-ui .button-secondary {
  35. display: inline-block;
  36. text-decoration: none;
  37. font-size: 13px;
  38. line-height: 2;
  39. min-height: 28px;
  40. margin: 0;
  41. padding: 0 10px;
  42. cursor: pointer;
  43. border-width: 1px;
  44. border-style: solid;
  45. -webkit-appearance: none;
  46. border-radius: 3px;
  47. white-space: nowrap;
  48. box-sizing: border-box;
  49. }
  50. /* Remove the dotted border on :focus and the extra padding in Firefox */
  51. .wp-core-ui button::-moz-focus-inner,
  52. .wp-core-ui input[type="reset"]::-moz-focus-inner,
  53. .wp-core-ui input[type="button"]::-moz-focus-inner,
  54. .wp-core-ui input[type="submit"]::-moz-focus-inner {
  55. border-width: 0;
  56. border-style: none;
  57. padding: 0;
  58. }
  59. .wp-core-ui .button.button-large,
  60. .wp-core-ui .button-group.button-large .button {
  61. min-height: 30px;
  62. line-height: 2.15384615;
  63. padding: 0 12px 2px;
  64. }
  65. .wp-core-ui .button.button-small,
  66. .wp-core-ui .button-group.button-small .button {
  67. min-height: 24px;
  68. line-height: 2;
  69. padding: 0 8px;
  70. font-size: 11px;
  71. }
  72. .wp-core-ui .button.button-hero,
  73. .wp-core-ui .button-group.button-hero .button {
  74. font-size: 14px;
  75. min-height: 46px;
  76. line-height: 3.14285714;
  77. padding: 0 36px;
  78. }
  79. .wp-core-ui .button.hidden {
  80. display: none;
  81. }
  82. /* Style Reset buttons as simple text links */
  83. .wp-core-ui input[type="reset"],
  84. .wp-core-ui input[type="reset"]:hover,
  85. .wp-core-ui input[type="reset"]:active,
  86. .wp-core-ui input[type="reset"]:focus {
  87. background: none;
  88. border: none;
  89. box-shadow: none;
  90. padding: 0 2px 1px;
  91. width: auto;
  92. }
  93. /* ----------------------------------------------------------------------------
  94. 2.0 - Default Button Style
  95. ---------------------------------------------------------------------------- */
  96. .wp-core-ui .button,
  97. .wp-core-ui .button-secondary {
  98. color: #0071a1;
  99. border-color: #0071a1;
  100. background: #f3f5f6;
  101. vertical-align: top;
  102. }
  103. .wp-core-ui p .button {
  104. vertical-align: baseline;
  105. }
  106. .wp-core-ui .button.hover,
  107. .wp-core-ui .button:hover,
  108. .wp-core-ui .button-secondary:hover{
  109. background: #f1f1f1;
  110. border-color: #016087;
  111. color: #016087;
  112. }
  113. .wp-core-ui .button.focus,
  114. .wp-core-ui .button:focus,
  115. .wp-core-ui .button-secondary:focus {
  116. background: #f3f5f6;
  117. border-color: #007cba;
  118. color: #016087;
  119. box-shadow: 0 0 0 1px #007cba;
  120. /* Only visible in Windows High Contrast mode */
  121. outline: 2px solid transparent;
  122. /* Reset inherited offset from Gutenberg */
  123. outline-offset: 0;
  124. }
  125. /* :active state */
  126. .wp-core-ui .button:active,
  127. .wp-core-ui .button-secondary:active {
  128. background: #f3f5f6;
  129. border-color: #7e8993;
  130. box-shadow: none;
  131. }
  132. /* pressed state e.g. a selected setting */
  133. .wp-core-ui .button.active,
  134. .wp-core-ui .button.active:hover {
  135. background-color: #e2e4e7;
  136. color: #00669b;
  137. border-color: #016087;
  138. box-shadow: inset 0 2px 5px -3px #016087;
  139. }
  140. .wp-core-ui .button.active:focus {
  141. border-color: #007cba;
  142. box-shadow:
  143. inset 0 2px 5px -3px #016087,
  144. 0 0 0 1px #007cba;
  145. }
  146. .wp-core-ui .button[disabled],
  147. .wp-core-ui .button:disabled,
  148. .wp-core-ui .button.disabled,
  149. .wp-core-ui .button-secondary[disabled],
  150. .wp-core-ui .button-secondary:disabled,
  151. .wp-core-ui .button-secondary.disabled,
  152. .wp-core-ui .button-disabled {
  153. color: #a0a5aa !important;
  154. border-color: #ddd !important;
  155. background: #f7f7f7 !important;
  156. box-shadow: none !important;
  157. text-shadow: 0 1px 0 #fff !important;
  158. cursor: default;
  159. transform: none !important;
  160. }
  161. /* Buttons that look like links, for a cross of good semantics with the visual */
  162. .wp-core-ui .button-link {
  163. margin: 0;
  164. padding: 0;
  165. box-shadow: none;
  166. border: 0;
  167. border-radius: 0;
  168. background: none;
  169. cursor: pointer;
  170. text-align: left;
  171. /* Mimics the default link style in common.css */
  172. color: #0073aa;
  173. text-decoration: underline;
  174. transition-property: border, background, color;
  175. transition-duration: .05s;
  176. transition-timing-function: ease-in-out;
  177. }
  178. .wp-core-ui .button-link:hover,
  179. .wp-core-ui .button-link:active {
  180. color: #00a0d2;
  181. }
  182. .wp-core-ui .button-link:focus {
  183. color: #124964;
  184. box-shadow:
  185. 0 0 0 1px #5b9dd9,
  186. 0 0 2px 1px rgba(30, 140, 190, 0.8);
  187. /* Only visible in Windows High Contrast mode */
  188. outline: 1px solid transparent;
  189. }
  190. .wp-core-ui .button-link-delete {
  191. color: #a00;
  192. }
  193. .wp-core-ui .button-link-delete:hover,
  194. .wp-core-ui .button-link-delete:focus {
  195. color: #dc3232;
  196. background: transparent;
  197. }
  198. .wp-core-ui .button-link-delete:disabled {
  199. /* overrides the default buttons disabled background */
  200. background: transparent !important;
  201. }
  202. .ie8 .wp-core-ui .button-link:focus {
  203. outline: #5b9dd9 solid 1px;
  204. }
  205. /* ----------------------------------------------------------------------------
  206. 3.0 - Primary Button Style
  207. ---------------------------------------------------------------------------- */
  208. .wp-core-ui .button-primary {
  209. background: #007cba;
  210. border-color: #007cba;
  211. color: #fff;
  212. text-decoration: none;
  213. text-shadow: none;
  214. }
  215. .wp-core-ui .button-primary.hover,
  216. .wp-core-ui .button-primary:hover,
  217. .wp-core-ui .button-primary.focus,
  218. .wp-core-ui .button-primary:focus {
  219. background: #0071a1;
  220. border-color: #0071a1;
  221. color: #fff;
  222. }
  223. .wp-core-ui .button-primary.focus,
  224. .wp-core-ui .button-primary:focus {
  225. box-shadow:
  226. 0 0 0 1px #fff,
  227. 0 0 0 3px #007cba;
  228. }
  229. .wp-core-ui .button-primary.active,
  230. .wp-core-ui .button-primary.active:hover,
  231. .wp-core-ui .button-primary.active:focus,
  232. .wp-core-ui .button-primary:active {
  233. background: #00669b;
  234. border-color: #00669b;
  235. box-shadow: none;
  236. color: #fff;
  237. }
  238. .wp-core-ui .button-primary[disabled],
  239. .wp-core-ui .button-primary:disabled,
  240. .wp-core-ui .button-primary-disabled,
  241. .wp-core-ui .button-primary.disabled {
  242. color: #66c6e4 !important;
  243. background: #008ec2 !important;
  244. border-color: #008ec2 !important;
  245. box-shadow: none !important;
  246. text-shadow: none !important;
  247. cursor: default;
  248. }
  249. /* ----------------------------------------------------------------------------
  250. 4.0 - Button Groups
  251. ---------------------------------------------------------------------------- */
  252. .wp-core-ui .button-group {
  253. position: relative;
  254. display: inline-block;
  255. white-space: nowrap;
  256. font-size: 0;
  257. vertical-align: middle;
  258. }
  259. .wp-core-ui .button-group > .button {
  260. display: inline-block;
  261. border-radius: 0;
  262. margin-right: -1px;
  263. }
  264. .wp-core-ui .button-group > .button:first-child {
  265. border-radius: 3px 0 0 3px;
  266. }
  267. .wp-core-ui .button-group > .button:last-child {
  268. border-radius: 0 3px 3px 0;
  269. }
  270. .wp-core-ui .button-group > .button-primary + .button {
  271. border-left: 0;
  272. }
  273. .wp-core-ui .button-group > .button:focus {
  274. position: relative;
  275. z-index: 1;
  276. }
  277. /* pressed state e.g. a selected setting */
  278. .wp-core-ui .button-group > .button.active {
  279. background-color: #e2e4e7;
  280. color: #00669b;
  281. border-color: #016087;
  282. box-shadow: inset 0 2px 5px -3px #016087;
  283. }
  284. .wp-core-ui .button-group > .button.active:focus {
  285. border-color: #007cba;
  286. box-shadow:
  287. inset 0 2px 5px -3px #016087,
  288. 0 0 0 1px #007cba;
  289. }
  290. /* ----------------------------------------------------------------------------
  291. 5.0 - Responsive Button Styles
  292. ---------------------------------------------------------------------------- */
  293. @media screen and (max-width: 782px) {
  294. .wp-core-ui .button,
  295. .wp-core-ui .button.button-large,
  296. .wp-core-ui .button.button-small,
  297. input#publish,
  298. input#save-post,
  299. a.preview {
  300. padding: 1px 14px;
  301. line-height: 2;
  302. font-size: 14px;
  303. vertical-align: middle;
  304. height: auto;
  305. margin-bottom: 4px;
  306. }
  307. #media-upload.wp-core-ui .button {
  308. padding: 0 10px 1px;
  309. min-height: 24px;
  310. line-height: 22px;
  311. font-size: 13px;
  312. }
  313. .media-frame.mode-grid .bulk-select .button {
  314. margin-bottom: 0;
  315. }
  316. /* Publish Metabox Options */
  317. .wp-core-ui .save-post-status.button {
  318. position: relative;
  319. margin: 0 14px 0 10px; /* 14px right margin to match all other buttons */
  320. }
  321. /* Reset responsive styles in Press This, Customizer */
  322. .wp-core-ui.wp-customizer .button {
  323. padding: 0 10px 1px;
  324. font-size: 13px;
  325. line-height: 2;
  326. min-height: 28px;
  327. margin: 0;
  328. vertical-align: inherit;
  329. }
  330. .media-modal-content .media-toolbar-primary .media-button {
  331. margin-top: 10px;
  332. margin-left: 5px;
  333. }
  334. /* Reset responsive styles on Log in button on iframed login form */
  335. .interim-login .button.button-large {
  336. min-height: 30px;
  337. line-height: 2;
  338. padding: 0 12px 2px;
  339. }
  340. }