button.css

Same filename in this branch
  1. main core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  2. main core/misc/dialog/off-canvas/css/button.css
  3. main core/themes/olivero/css/components/button.css
  4. main core/themes/starterkit_theme/css/components/button.css
  5. main core/assets/vendor/jquery.ui/themes/base/button.css
Same filename and directory in other branches
  1. 10 core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  2. 10 core/misc/dialog/off-canvas/css/button.css
  3. 10 core/themes/olivero/css/components/button.css
  4. 10 core/themes/claro/css/components/button.css
  5. 10 core/themes/starterkit_theme/css/components/button.css
  6. 11.x core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  7. 11.x core/misc/dialog/off-canvas/css/button.css
  8. 11.x core/themes/olivero/css/components/button.css
  9. 11.x core/themes/claro/css/components/button.css
  10. 11.x core/themes/starterkit_theme/css/components/button.css
  11. 11.x core/assets/vendor/jquery.ui/themes/base/button.css
  12. 10 core/assets/vendor/jquery.ui/themes/base/button.css
  13. 9 core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  14. 9 core/themes/olivero/css/components/button.css
  15. 9 core/themes/seven/css/classy/components/button.css
  16. 9 core/themes/claro/css/components/button.css
  17. 9 core/themes/bartik/css/classy/components/button.css
  18. 9 core/themes/starterkit_theme/css/components/button.css
  19. 9 core/themes/classy/css/components/button.css
  20. 9 core/assets/vendor/jquery.ui/themes/base/button.css
  21. 8.9.x core/profiles/demo_umami/themes/umami/css/classy/components/button.css
  22. 8.9.x core/themes/seven/css/classy/components/button.css
  23. 8.9.x core/themes/claro/css/components/button.css
  24. 8.9.x core/themes/bartik/css/classy/components/button.css
  25. 8.9.x core/themes/classy/css/components/button.css
  26. 8.9.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. Prevent fat text in WebKit.
  19. *
  20. * @todo Consider moving box-sizing into base.css under a universal selector.
  21. * See https://www.drupal.org/node/2124251
  22. */
  23. /**
  24. * Base button styles.
  25. *
  26. * These styles have been duplicated to dropbutton.css and action-links.css
  27. * since those components inherits most of these design elements. Whenever
  28. * making changes to this file, remember to check if that needs to be applied to
  29. * dropbutton.css or action-links.css as well.
  30. */
  31. .button {
  32. display: inline-block;
  33. margin-block: var(--space-m);
  34. margin-inline: 0 var(--space-s);
  35. padding: calc(var(--space-m) - 1px) calc(var(--space-l) - 1px); /* 1 */
  36. cursor: pointer;
  37. text-align: center;
  38. -webkit-text-decoration: none;
  39. text-decoration: none;
  40. color: var(--button-fg-color);
  41. border: 1px solid transparent;
  42. border-radius: var(--button-border-radius-size);
  43. background-color: var(--button-bg-color);
  44. font-size: var(--font-size-base);
  45. font-weight: 700;
  46. line-height: 1rem;
  47. appearance: none;
  48. -webkit-font-smoothing: antialiased; /* 2 */
  49. &:not(:focus) {
  50. box-shadow: 0 1px 2px rgb(0, 0, 0, 0.25);
  51. }
  52. &:hover {
  53. -webkit-text-decoration: none;
  54. text-decoration: none;
  55. color: var(--button-fg-color);
  56. background-color: var(--button--hover-bg-color);
  57. }
  58. &:focus {
  59. -webkit-text-decoration: none;
  60. text-decoration: none;
  61. }
  62. &:active {
  63. background-color: var(--button--active-bg-color);
  64. }
  65. }
  66. /* Common styles for small buttons. */
  67. .no-touchevents {
  68. & .button--small {
  69. margin-block: var(--space-s);
  70. margin-inline: 0 var(--space-xs);
  71. padding: calc(var(--space-xs) - 1px) calc(var(--space-m) - 1px); /* 1 */
  72. font-size: var(--font-size-xs);
  73. }
  74. /* Common styles for extra small buttons. */
  75. & .button--extrasmall {
  76. margin-block: var(--space-xs);
  77. margin-inline: 0 var(--space-xs);
  78. padding: calc(calc(var(--space-xs) / 2) - 1px) calc(var(--space-s) - 1px); /* 1 */
  79. font-size: var(--font-size-xs);
  80. }
  81. }
  82. /* Styles for action link buttons. */
  83. .button--action {
  84. margin: 0;
  85. &::before {
  86. margin-inline: -0.25em 0;
  87. padding-inline: 0 0.25em;
  88. content: "+";
  89. font-weight: 900;
  90. }
  91. }
  92. /* Primary button style.s */
  93. .button--primary {
  94. color: var(--button-fg-color--primary);
  95. background-color: var(--button-bg-color--primary);
  96. &:is(:hover, :active) {
  97. color: var(--button-fg-color--primary);
  98. background-color: var(--button--hover-bg-color--primary);
  99. }
  100. }
  101. /* Danger button styles */
  102. .button--danger {
  103. color: var(--button-fg-color--danger);
  104. background-color: var(--button-bg-color--danger);
  105. &:is(:hover, :active) {
  106. color: var(--button-fg-color--danger);
  107. background-color: var(--button--hover-bg-color--danger);
  108. }
  109. }
  110. /**
  111. * Disabled state styles as last.
  112. *
  113. * Overrides every definitions before, including variants.
  114. */
  115. .button {
  116. &:is(:disabled, .is-disabled) {
  117. color: var(--button--disabled-fg-color);
  118. background-color: var(--button--disabled-bg-color);
  119. }
  120. /* Make disabled behave like a [disabled] or . */
  121. &.is-disabled {
  122. -webkit-user-select: none;
  123. user-select: none;
  124. pointer-events: none;
  125. }
  126. }
  127. /**
  128. * Style a clickable/tappable element as a link. Duplicates the base style for
  129. * the tag, plus a reset for padding, borders and background.
  130. */
  131. .link {
  132. display: inline;
  133. padding: 0;
  134. cursor: pointer;
  135. -webkit-text-decoration: underline;
  136. text-decoration: underline;
  137. border: 0;
  138. background: none;
  139. appearance: none;
  140. }