button.css

Same filename in this branch
  1. 9 core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  2. 9 core/themes/olivero/css/components/button.css
  3. 9 core/themes/seven/css/classy/components/button.css
  4. 9 core/themes/bartik/css/classy/components/button.css
  5. 9 core/themes/starterkit_theme/css/components/button.css
  6. 9 core/themes/classy/css/components/button.css
  7. 9 core/assets/vendor/jquery.ui/themes/base/button.css
Same filename in other branches
  1. 8.9.x core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  2. 8.9.x core/themes/seven/css/classy/components/button.css
  3. 8.9.x core/themes/claro/css/components/button.css
  4. 8.9.x core/themes/bartik/css/classy/components/button.css
  5. 8.9.x core/themes/classy/css/components/button.css
  6. 8.9.x core/assets/vendor/jquery.ui/themes/base/button.css
  7. 10 core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  8. 10 core/misc/dialog/off-canvas/css/button.css
  9. 10 core/themes/olivero/css/components/button.css
  10. 10 core/themes/claro/css/components/button.css
  11. 10 core/themes/starterkit_theme/css/components/button.css
  12. 10 core/assets/vendor/jquery.ui/themes/base/button.css
  13. 11.x core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  14. 11.x core/misc/dialog/off-canvas/css/button.css
  15. 11.x core/themes/olivero/css/components/button.css
  16. 11.x core/themes/claro/css/components/button.css
  17. 11.x core/themes/starterkit_theme/css/components/button.css
  18. 11.x core/assets/vendor/jquery.ui/themes/base/button.css

Structural styles for Claro's UI buttons

Apply these classes to button elements (<button>, <input type="button" />).

File

core/themes/claro/css/components/button.css

View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Structural styles for Claro's UI buttons
  10. *
  11. * Apply these classes to button elements (, ).
  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. border: 1px solid transparent !important;
  36. }
  37. .button {
  38. display: inline-block;
  39. margin: 1rem 0.75rem 1rem 0; /* LTR */
  40. padding: calc(1rem - 1px) calc(1.5rem - 1px); /* 1 */
  41. cursor: pointer;
  42. text-align: center;
  43. text-decoration: none;
  44. color: #232429; /* 2 */
  45. border-radius: 2px;
  46. background-color: #d3d4d9;
  47. font-size: 1rem;
  48. font-weight: 700;
  49. line-height: 1rem;
  50. -webkit-appearance: none;
  51. appearance: none;
  52. -webkit-font-smoothing: antialiased; /* 3 */
  53. }
  54. [dir="rtl"] .button {
  55. margin: 1rem 0 1rem 0.75rem;
  56. }
  57. .button:not(:focus) {
  58. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  59. }
  60. .button:hover {
  61. text-decoration: none;
  62. background-color: #c1c2c7;
  63. }
  64. .button:focus {
  65. text-decoration: none;
  66. }
  67. .button:active {
  68. background-color: #adaeb3;
  69. }
  70. /* Common styles for small buttons */
  71. .no-touchevents .button--small {
  72. margin: 0.75rem 0.5rem 0.75rem 0; /* LTR */
  73. padding: calc(0.5rem - 1px) calc(1rem - 1px); /* 1 */
  74. font-size: 0.79rem;
  75. }
  76. /* Common styles for extra small buttons */
  77. .no-touchevents .button--extrasmall {
  78. margin: 0.5rem 0.5rem 0.5rem 0; /* LTR */
  79. padding: calc(0.25rem - 1px) calc(0.75rem - 1px); /* 1 */
  80. font-size: 0.79rem;
  81. }
  82. [dir="rtl"].no-touchevents .button--small,
  83. [dir="rtl"].no-touchevents .button--extrasmall {
  84. margin-right: 0;
  85. margin-left: 0.5rem;
  86. }
  87. /* Styles for action link buttons */
  88. .button--action {
  89. margin: 0;
  90. }
  91. .button--action::before {
  92. margin-left: -0.25em; /* LTR */
  93. padding-right: 0.25em; /* LTR */
  94. content: "+";
  95. font-weight: 900;
  96. }
  97. [dir="rtl"] .button--action::before {
  98. margin-right: -0.25em;
  99. margin-left: 0;
  100. padding-right: 0;
  101. padding-left: 0.25em;
  102. }
  103. a.button:hover,
  104. a.button:active {
  105. color: #232429;
  106. }
  107. /* Primary button styles */
  108. .button--primary {
  109. color: #fff;
  110. background-color: #003ecc;
  111. }
  112. .button--primary:hover {
  113. color: #fff;
  114. background-color: #0036b1;
  115. }
  116. .button--primary:active {
  117. background-color: #002e9a;
  118. }
  119. a.button--primary:hover,
  120. a.button--primary:active {
  121. color: #fff;
  122. }
  123. /* Danger button styles */
  124. .button--danger {
  125. color: #fff;
  126. background-color: #dc2323;
  127. }
  128. .button--danger:hover {
  129. color: #fff;
  130. background-color: #c61f1f;
  131. }
  132. .button--danger:active {
  133. background-color: #b01c1c;
  134. }
  135. a.button--danger:hover,
  136. a.button--danger:active {
  137. color: #fff;
  138. }
  139. /**
  140. * Disabled state styles as last.
  141. *
  142. * Overrides every definitions before, including variants.
  143. */
  144. .button:disabled,
  145. .button.is-disabled {
  146. color: #919297;
  147. background-color: #ebebed;
  148. }
  149. .button--primary:disabled,
  150. .button--primary.is-disabled {
  151. color: #828388;
  152. background-color: #d3d4d9;
  153. }
  154. /* Make disabled behave like a [disabled] or */
  155. .button.is-disabled {
  156. -webkit-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 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. appearance: none;
  174. }