You are here

buttons.css in Dialog 7.2

Structural styles for Seven’s UI buttons

Apply these classes to any element (<link>, <button>, <input>, etc.) that should appear as a button.

File

themes/seven/css/components/buttons.css
View source
  1. /**
  2. * @file
  3. * Structural styles for Seven’s UI buttons
  4. *
  5. * Apply these classes to any element (,
  6. * should appear as a button.
  7. */
  8. /**
  9. * Buttons.
  10. *
  11. * 1. Enable z-index on buttons.
  12. * 2. Normalize 'line-height'; can’t be changed from 'normal' in Firefox 4+.
  13. * 3. Allows full range of styling in Webkit and Gecko.
  14. * 4. Use px units to ensure button text is centered vertically.
  15. * 5. Use rems to avoid the font size cascade of ems, with a px fallback for
  16. * older browsers.
  17. * 6. Prevent fat text in WebKit.
  18. *
  19. * @todo Consider moving box-sizing into base.css under a universal selector.
  20. * See https://www.drupal.org/node/2124251
  21. *
  22. */
  23. .button {
  24. box-sizing: border-box;
  25. display: inline-block;
  26. position: relative; /* 1 */
  27. text-align: center;
  28. line-height: normal; /* 2 */
  29. cursor: pointer;
  30. -webkit-appearance: none; /* 3 */
  31. -moz-appearance: none; /* 3 */
  32. padding: 4px 1.5em; /* 4 */
  33. border: 1px solid #a6a6a6;
  34. border-radius: 20em;
  35. background-color: #f2f1eb;
  36. background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
  37. background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
  38. color: #333;
  39. text-decoration: none;
  40. text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
  41. font-weight: 600;
  42. font-size: 14px;
  43. font-size: 0.875rem; /* 5 */
  44. -webkit-transition: all 0.1s;
  45. transition: all 0.1s;
  46. -webkit-font-smoothing: antialiased; /* 6 */
  47. }
  48. .button:hover,
  49. .button:focus {
  50. background-color: #f9f8f6;
  51. background-image: -webkit-linear-gradient(top, #fcfcfa, #e9e9dd);
  52. background-image: linear-gradient(to bottom, #fcfcfa, #e9e9dd);
  53. color: #1a1a1a;
  54. text-decoration: none;
  55. outline: none;
  56. }
  57. .button:hover {
  58. box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.125);
  59. }
  60. /* Prevent focus ring being covered by next siblings. */
  61. .button:focus {
  62. z-index: 10;
  63. border: 1px solid #3AB2FF;
  64. box-shadow: 0 0 0.5em 0.1em hsla(203, 100%, 60%, 0.7);
  65. }
  66. .button:active {
  67. border: 1px solid #a6a6a6;
  68. background-color: #dfdfd9;
  69. background-image: -webkit-linear-gradient(top, #f6f6f3, #e7e7df);
  70. background-image: linear-gradient(to bottom, #f6f6f3, #e7e7df);
  71. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  72. -webkit-transition: none;
  73. transition: none;
  74. }
  75. .button--primary {
  76. border-color: #1e5c90;
  77. background-color: #0071b8;
  78. background-image: -webkit-linear-gradient(top, #007bc6, #0071b8);
  79. background-image: linear-gradient(to bottom, #007bc6, #0071b8);
  80. color: #fff;
  81. text-shadow: 0 1px hsla(0, 0%, 0%, 0.5);
  82. font-weight: 700;
  83. -webkit-font-smoothing: antialiased;
  84. }
  85. .button--primary:hover,
  86. .button--primary:focus {
  87. background-color: #2369a6;
  88. background-image: -webkit-linear-gradient(top, #0c97ed, #1f86c7);
  89. background-image: linear-gradient(to bottom, #0c97ed, #1f86c7);
  90. border-color: #1e5c90;
  91. color: #fff;
  92. }
  93. .button--primary:focus {
  94. border: 1px solid #1280DF;
  95. }
  96. .button--primary:hover {
  97. box-shadow: 0 1px 2px hsla(203, 10%, 10%, 0.25);
  98. }
  99. .button--primary:active {
  100. background-image: -webkit-linear-gradient(top, #08639b, #0071b8);
  101. background-image: linear-gradient(to bottom, #08639b, #0071b8);
  102. border-color: #144b78;
  103. box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.2);
  104. }
  105. /**
  106. * Overrides styling from system.theme.
  107. */
  108. .button-action:before {
  109. margin-left: -0.2em; /* LTR */
  110. padding-right: 0.2em; /* LTR */
  111. font-size: 14px;
  112. font-size: 0.875rem;
  113. line-height: 16px;
  114. -webkit-font-smoothing: auto;
  115. }
  116. [dir="rtl"] .button-action:before {
  117. margin-right: -0.2em;
  118. margin-left: 0;
  119. padding-right: 0;
  120. padding-left: 0.2em;
  121. }
  122. /**
  123. * 1. Use px units to ensure button text is centered vertically.
  124. */
  125. .no-touch .button--small {
  126. font-size: 13px;
  127. font-size: 0.813rem;
  128. padding: 2px 1em; /* 1 */
  129. }
  130. .button:disabled,
  131. .button:disabled:active,
  132. .button.is-disabled,
  133. .button.is-disabled:active {
  134. border-color: #d4d4d4;
  135. background: #ededed;
  136. box-shadow: none;
  137. color: #5c5c5c;
  138. font-weight: normal;
  139. cursor: default;
  140. text-shadow: 0 1px hsla(0, 0%, 100%, 0.6);
  141. }
  142. /* Link actions. */
  143. /**
  144. * Style a clickable/tappable element as a link. Duplicates the base style for
  145. * the tag, plus a reset for padding, borders and background.
  146. */
  147. .link {
  148. display: inline;
  149. cursor: pointer;
  150. padding: 0;
  151. border: 0;
  152. background: none;
  153. -webkit-appearance: none;
  154. -moz-appearance: none;
  155. color: #0074bd;
  156. text-decoration: none;
  157. }
  158. .link:hover,
  159. .link:focus {
  160. color: #008ee6;
  161. text-decoration: underline;
  162. }
  163. /**
  164. * We've temporarily added the danger button here, bit of a harsh reset but we
  165. * need it.
  166. * @todo replace with link--danger.
  167. * See https://www.drupal.org/node/2123731
  168. */
  169. .button--danger {
  170. display: inline;
  171. cursor: pointer;
  172. padding: 0;
  173. border: 0;
  174. border-radius: 0;
  175. box-shadow: none;
  176. background: none;
  177. -webkit-appearance: none;
  178. -moz-appearance: none;
  179. color: #c72100;
  180. font-weight: 400;
  181. text-decoration: underline;
  182. }
  183. .button--danger:hover,
  184. .button--danger:focus,
  185. .button--danger:active {
  186. color: #ff2a00;
  187. text-decoration: underline;
  188. text-shadow: none;
  189. padding: 0;
  190. border: 0;
  191. box-shadow: none;
  192. background: none;
  193. }
  194. .button--danger:disabled,
  195. .button--danger.is-disabled {
  196. color: #737373;
  197. cursor: default;
  198. text-decoration: none;
  199. -webkit-font-smoothing: antialiased;
  200. padding: 0;
  201. border: 0;
  202. box-shadow: none;
  203. background: none;
  204. }