button.css

Same filename in this branch
  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/bartik/css/classy/components/button.css
  4. 8.9.x core/themes/classy/css/components/button.css
  5. 8.9.x core/assets/vendor/jquery.ui/themes/base/button.css
Same filename in other branches
  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/claro/css/components/button.css
  5. 9 core/themes/bartik/css/classy/components/button.css
  6. 9 core/themes/starterkit_theme/css/components/button.css
  7. 9 core/themes/classy/css/components/button.css
  8. 9 core/assets/vendor/jquery.ui/themes/base/button.css
  9. 10 core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  10. 10 core/misc/dialog/off-canvas/css/button.css
  11. 10 core/themes/olivero/css/components/button.css
  12. 10 core/themes/claro/css/components/button.css
  13. 10 core/themes/starterkit_theme/css/components/button.css
  14. 10 core/assets/vendor/jquery.ui/themes/base/button.css
  15. 11.x core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  16. 11.x core/misc/dialog/off-canvas/css/button.css
  17. 11.x core/themes/olivero/css/components/button.css
  18. 11.x core/themes/claro/css/components/button.css
  19. 11.x core/themes/starterkit_theme/css/components/button.css
  20. 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/2815083
  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. 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 behave like a [disabled] or */
  154. .button.is-disabled {
  155. -webkit-user-select: none;
  156. -ms-user-select: none;
  157. user-select: none;
  158. pointer-events: none;
  159. }
  160. /**
  161. * Style a clickable/tappable element as a link. Duplicates the base style for
  162. * the tag, plus a reset for padding, borders and background.
  163. */
  164. .link {
  165. display: inline;
  166. padding: 0;
  167. cursor: pointer;
  168. text-decoration: underline;
  169. border: 0;
  170. background: none;
  171. -webkit-appearance: none;
  172. -moz-appearance: none;
  173. appearance: none;
  174. }