button.css 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/2815083
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Structural styles for Claro's UI buttons
  10. *
  11. * Apply these classes to button elements (<button>, <input type="button" />).
  12. */
  13. /**
  14. * Buttons.
  15. *
  16. * 1. Padding widths detracted by width of the transparent borders to make
  17. * button size match with design system.
  18. * 2. Transparent border is needed for high contrast mode. This has to be set to
  19. * !important to render Firefox borders with consistent width in high
  20. * contrast mode.
  21. * 3. Prevent fat text in WebKit.
  22. *
  23. * @todo Consider moving box-sizing into base.css under a universal selector.
  24. * See https://www.drupal.org/node/2124251
  25. */
  26. /**
  27. * Base button styles.
  28. *
  29. * These styles have been duplicated to dropbutton.css and action-links.css
  30. * since those components inherits most of these design elements. Whenever
  31. * making changes to this file, remember to check if that needs to be applied to
  32. * dropbutton.css or action-links.css as well.
  33. */
  34. .button {
  35. display: inline-block;
  36. margin: 1rem 0.75rem 1rem 0; /* LTR */
  37. padding: calc(1rem - 1px) calc(1.5rem - 1px); /* 1 */
  38. cursor: pointer;
  39. text-align: center;
  40. text-decoration: none;
  41. color: #222330;
  42. border: 1px solid transparent !important; /* 2 */
  43. border-radius: 2px;
  44. background-color: #d4d4d8;
  45. font-size: 1rem;
  46. font-weight: 700;
  47. line-height: 1rem;
  48. -webkit-appearance: none;
  49. -moz-appearance: none;
  50. appearance: none;
  51. -webkit-font-smoothing: antialiased; /* 3 */
  52. }
  53. [dir="rtl"] .button {
  54. margin: 1rem 0 1rem 0.75rem;
  55. }
  56. .button:not(:focus) {
  57. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  58. }
  59. .button:hover {
  60. text-decoration: none;
  61. background-color: #c2c3ca;
  62. }
  63. .button:focus {
  64. text-decoration: none;
  65. }
  66. .button:active {
  67. background-color: #adaeb3;
  68. }
  69. /* Common styles for small buttons */
  70. .no-touchevents .button--small {
  71. margin: 0.75rem 0.5rem 0.75rem 0; /* LTR */
  72. padding: calc(0.5rem - 1px) calc(1rem - 1px); /* 1 */
  73. font-size: 0.79rem;
  74. }
  75. /* Common styles for extra small buttons */
  76. .no-touchevents .button--extrasmall {
  77. margin: 0.5rem 0.5rem 0.5rem 0; /* LTR */
  78. padding: calc(0.25rem - 1px) calc(0.75rem - 1px); /* 1 */
  79. font-size: 0.79rem;
  80. }
  81. [dir="rtl"].no-touchevents .button--small,
  82. [dir="rtl"].no-touchevents .button--extrasmall {
  83. margin-right: 0;
  84. margin-left: 0.5rem;
  85. }
  86. /* Styles for action link buttons */
  87. .button--action {
  88. margin: 0;
  89. }
  90. .button--action::before {
  91. margin-left: -0.25em; /* LTR */
  92. padding-right: 0.25em; /* LTR */
  93. content: "+";
  94. font-weight: 900;
  95. }
  96. [dir="rtl"] .button--action::before {
  97. margin-right: -0.25em;
  98. margin-left: 0;
  99. padding-right: 0;
  100. padding-left: 0.25em;
  101. }
  102. a.button:hover,
  103. a.button:active {
  104. color: #222330;
  105. }
  106. /* Primary button styles */
  107. .button--primary {
  108. color: #fff;
  109. background-color: #003cc5;
  110. }
  111. .button--primary:hover {
  112. color: #fff;
  113. background-color: #0036b1;
  114. }
  115. .button--primary:active {
  116. background-color: #00339a;
  117. }
  118. a.button--primary:hover,
  119. a.button--primary:active {
  120. color: #fff;
  121. }
  122. /* Danger button styles */
  123. .button--danger {
  124. color: #fff;
  125. background-color: #d72222;
  126. }
  127. .button--danger:hover {
  128. color: #fff;
  129. background-color: #c11f1f;
  130. }
  131. .button--danger:active {
  132. background-color: #ab1b1b;
  133. }
  134. a.button--danger:hover,
  135. a.button--danger:active {
  136. color: #fff;
  137. }
  138. /**
  139. * Disabled state styles as last.
  140. *
  141. * Overrides every definitions before, including variants.
  142. */
  143. .button:disabled,
  144. .button.is-disabled {
  145. color: #8e929c;
  146. background-color: #ebebed;
  147. }
  148. .button--primary:disabled,
  149. .button--primary.is-disabled {
  150. color: #82828c;
  151. background-color: #d4d4d8;
  152. }
  153. /* Make disabled <link> behave like a [disabled] <input> or <button> */
  154. .button.is-disabled {
  155. -webkit-user-select: none;
  156. -moz-user-select: none;
  157. -ms-user-select: none;
  158. user-select: none;
  159. pointer-events: none;
  160. }
  161. /**
  162. * Style a clickable/tappable element as a link. Duplicates the base style for
  163. * the <a> tag, plus a reset for padding, borders and background.
  164. */
  165. .link {
  166. display: inline;
  167. padding: 0;
  168. cursor: pointer;
  169. text-decoration: underline;
  170. border: 0;
  171. background: none;
  172. -webkit-appearance: none;
  173. -moz-appearance: none;
  174. appearance: none;
  175. }