button.pcss.css

Same filename in this branch
  1. 11.x core/themes/olivero/css/components/button.pcss.css
  2. 11.x core/themes/claro/css/components/button.pcss.css
Same filename in other branches
  1. 9 core/themes/olivero/css/components/button.pcss.css
  2. 9 core/themes/claro/css/components/button.pcss.css
  3. 8.9.x core/themes/claro/css/components/button.pcss.css
  4. 10 core/misc/dialog/off-canvas/css/button.pcss.css
  5. 10 core/themes/olivero/css/components/button.pcss.css
  6. 10 core/themes/claro/css/components/button.pcss.css

Visual styling for buttons in the off-canvas dialog.

@internal

File

core/misc/dialog/off-canvas/css/button.pcss.css

View source
  1. /**
  2. * @file
  3. * Visual styling for buttons in the off-canvas dialog.
  4. *
  5. * @internal
  6. */
  7. #drupal-off-canvas-wrapper {
  8. --off-canvas-button-background-color: #777;
  9. --off-canvas-button-background-color-hover: #999;
  10. --off-canvas-button-text-color: #f5f5f5;
  11. --off-canvas-button-text-color-hover: #fff;
  12. --off-canvas-button-font-size: 14px;
  13. --off-canvas-button-padding: calc(var(--off-canvas-vertical-spacing-unit) / 2) 20px;
  14. --off-canvas-button-border-color: transparent;
  15. --off-canvas-button-border-radius: 20em;
  16. --off-canvas-button-font-weight: 600;
  17. --off-canvas-primary-button-background-color: #277abd;
  18. --off-canvas-primary-button-background-color-hover: #236aaf;
  19. --off-canvas-primary-button-text-color: #fff;
  20. --off-canvas-primary-button-text-color-hover: #fff;
  21. & .button {
  22. display: inline-block;
  23. width: 100%;
  24. height: auto;
  25. margin: 0 0 10px;
  26. padding: var(--off-canvas-button-padding);
  27. cursor: pointer;
  28. transition: background 0.5s ease;
  29. text-align: center;
  30. color: var(--off-canvas-button-text-color);
  31. border: solid 1px var(--off-canvas-button-border-color);
  32. border-radius: var(--off-canvas-button-border-radius);
  33. background: var(--off-canvas-button-background-color);
  34. font-family: inherit;
  35. font-size: var(--off-canvas-button-font-size);
  36. font-weight: var(--off-canvas-button-font-weight);
  37. line-height: normal;
  38. appearance: none;
  39. &:hover,
  40. &:active {
  41. z-index: 10;
  42. text-decoration: none;
  43. color: var(--off-canvas-button-text-color-hover);
  44. background-color: var(--off-canvas-button-background-color-hover);
  45. }
  46. &:disabled,
  47. &:disabled:active,
  48. &.is-disabled,
  49. &.is-disabled:active {
  50. cursor: default;
  51. color: #5c5c5c;
  52. background: #555;
  53. font-weight: normal;
  54. }
  55. }
  56. & .button--primary {
  57. margin-top: 15px;
  58. color: var(--off-canvas-primary-button-text-color);
  59. background: var(--off-canvas-primary-button-background-color);
  60. &:hover,
  61. &:active {
  62. color: var(--off-canvas-primary-button-text-color-hover);
  63. background: var(--off-canvas-primary-button-background-color-hover);
  64. }
  65. }
  66. & button.link {
  67. display: inline;
  68. transition: color 0.5s ease;
  69. color: var(--off-canvas-link-color);
  70. border: 0;
  71. background: transparent;
  72. font-size: var(--off-canvas-button-font-size);
  73. &:hover,
  74. &:focus {
  75. text-decoration: none;
  76. color: var(--off-canvas-link-color);
  77. }
  78. }
  79. & .button--danger {
  80. text-decoration: none;
  81. color: #c72100;
  82. border-radius: 0;
  83. font-weight: 400;
  84. &:hover,
  85. &:focus,
  86. &:active {
  87. text-decoration: none;
  88. color: #ff2a00;
  89. text-shadow: none;
  90. }
  91. &:disabled,
  92. &.is-disabled {
  93. cursor: default;
  94. color: #737373;
  95. }
  96. }
  97. @nest .no-touchevents & .button--small {
  98. padding: 2px 1em;
  99. font-size: 13px;
  100. }
  101. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.