dropbutton.css

Same filename in this branch
  1. 11.x core/profiles/demo_umami/themes/umami/css/classy/components/dropbutton.css
  2. 11.x core/misc/dropbutton/dropbutton.css
  3. 11.x core/themes/olivero/css/components/dropbutton.css
  4. 11.x core/themes/stable9/css/core/dropbutton/dropbutton.css
  5. 11.x core/themes/claro/css/components/dropbutton.css
  6. 11.x core/themes/starterkit_theme/css/components/dropbutton.css
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/css/classy/components/dropbutton.css
  2. 9 core/misc/dropbutton/dropbutton.css
  3. 9 core/themes/olivero/css/components/dropbutton.css
  4. 9 core/themes/stable9/css/core/dropbutton/dropbutton.css
  5. 9 core/themes/seven/css/classy/components/dropbutton.css
  6. 9 core/themes/claro/css/components/dropbutton.css
  7. 9 core/themes/bartik/css/classy/components/dropbutton.css
  8. 9 core/themes/stable/css/core/dropbutton/dropbutton.css
  9. 9 core/themes/starterkit_theme/css/components/dropbutton.css
  10. 9 core/themes/classy/css/components/dropbutton.css
  11. 8.9.x core/profiles/demo_umami/themes/umami/css/classy/components/dropbutton.css
  12. 8.9.x core/misc/dropbutton/dropbutton.css
  13. 8.9.x core/themes/seven/css/classy/components/dropbutton.css
  14. 8.9.x core/themes/claro/css/components/dropbutton.css
  15. 8.9.x core/themes/bartik/css/classy/components/dropbutton.css
  16. 8.9.x core/themes/stable/css/core/dropbutton/dropbutton.css
  17. 8.9.x core/themes/classy/css/components/dropbutton.css
  18. 10 core/profiles/demo_umami/themes/umami/css/classy/components/dropbutton.css
  19. 10 core/misc/dialog/off-canvas/css/dropbutton.css
  20. 10 core/misc/dropbutton/dropbutton.css
  21. 10 core/themes/olivero/css/components/dropbutton.css
  22. 10 core/themes/stable9/css/core/dropbutton/dropbutton.css
  23. 10 core/themes/claro/css/components/dropbutton.css
  24. 10 core/themes/starterkit_theme/css/components/dropbutton.css

Styles for dropbuttons in the off-canvas dialog.

@internal

File

core/misc/dialog/off-canvas/css/dropbutton.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. * Styles for dropbuttons in the off-canvas dialog.
  10. *
  11. * @internal
  12. */
  13. #drupal-off-canvas-wrapper {
  14. --off-canvas-dropbutton-height: 1.5rem;
  15. --off-canvas-dropbutton-primary-background-color: var(--off-canvas-button-background-color);
  16. --off-canvas-dropbutton-secondary-background-color: var(--off-canvas-button-hover-background-color);
  17. --off-canvas-dropbutton-border-color: transparent;
  18. --off-canvas-dropbutton-border-width: 1px;
  19. --off-canvas-dropbutton-border-radius: 2px;
  20. --off-canvas-dropbutton-focus-outline-color: var(--off-canvas-focus-outline-color);
  21. --off-canvas-dropbutton-font-size: 0.75rem;
  22. --off-canvas-dropbutton-text-color: var(--off-canvas-button-text-color); /* Minimum 4.5:1 contrast ratio against --off-canvas-dropbutton-primary-background-color and --off-canvas-dropbutton-secondary-background-color. */
  23. --off-canvas-dropbutton-text-color-hover: var(--off-canvas-button-text-color-hover); /* Minimum 4.5:1 contrast ratio against --off-canvas-dropbutton-primary-background-color and --off-canvas-dropbutton-secondary-background-color. */
  24. }
  25. #drupal-off-canvas-wrapper .dropbutton-wrapper {
  26. margin-block: var(--off-canvas-vertical-spacing-unit);
  27. /*
  28. * Styles for when the dropbutton is expanded.
  29. */
  30. }
  31. #drupal-off-canvas-wrapper .dropbutton-wrapper.open {
  32. position: relative;
  33. z-index: 100;
  34. }
  35. #drupal-off-canvas-wrapper .dropbutton-wrapper.open .secondary-action {
  36. visibility: visible;
  37. }
  38. #drupal-off-canvas-wrapper .dropbutton-wrapper.open .dropbutton-widget {
  39. border-radius: var(--off-canvas-dropbutton-border-radius) var(--off-canvas-dropbutton-border-radius) 0 0;
  40. }
  41. #drupal-off-canvas-wrapper .dropbutton-wrapper.open .dropbutton-toggle button::before {
  42. transform: translateY(25%) rotate(225deg);
  43. }
  44. /*
  45. * Styles for single link variant of dropbutton.
  46. */
  47. #drupal-off-canvas-wrapper .dropbutton-wrapper.dropbutton-single .dropbutton-widget {
  48. padding-inline-end: 0;
  49. }
  50. #drupal-off-canvas-wrapper .dropbutton-wrapper.dropbutton-single .dropbutton-action:first-child {
  51. border-right: solid 1px var(--off-canvas-dropbutton-border-color); /* LTR */
  52. border-radius: var(--off-canvas-dropbutton-border-radius);
  53. }
  54. #drupal-off-canvas-wrapper .dropbutton-wrapper.dropbutton-single .dropbutton-action:first-child:dir(rtl) {
  55. border: solid 1px var(--off-canvas-dropbutton-border-color);
  56. }
  57. #drupal-off-canvas-wrapper .dropbutton-wrapper.dropbutton-single .dropbutton-action a {
  58. justify-content: center;
  59. }
  60. #drupal-off-canvas-wrapper .dropbutton-widget {
  61. position: relative;
  62. width: max-content;
  63. max-width: 100%;
  64. height: var(--off-canvas-dropbutton-height);
  65. padding-inline-end: var(--off-canvas-dropbutton-height);
  66. border-radius: var(--off-canvas-dropbutton-border-radius);
  67. }
  68. #drupal-off-canvas-wrapper .dropbutton {
  69. height: var(--off-canvas-dropbutton-height);
  70. margin-block: 0;
  71. margin-inline-start: 0;
  72. padding-inline-start: 0;
  73. list-style: none;
  74. font-size: var(--off-canvas-dropbutton-font-size);
  75. }
  76. /* This is the button that expands/collapses the secondary options. */
  77. #drupal-off-canvas-wrapper .dropbutton-toggle {
  78. padding: 0;
  79. border: 0;
  80. }
  81. #drupal-off-canvas-wrapper .dropbutton-toggle button {
  82. position: absolute;
  83. top: 0;
  84. display: flex;
  85. align-items: center;
  86. justify-content: center;
  87. width: var(--off-canvas-dropbutton-height);
  88. height: var(--off-canvas-dropbutton-height);
  89. padding: 0;
  90. cursor: pointer;
  91. border-color: var(--off-canvas-dropbutton-border-color);
  92. border-radius: 0 var(--border-radius) var(--border-radius) 0; /* LTR */
  93. background: var(--off-canvas-dropbutton-primary-background-color);
  94. inset-inline-end: 0;
  95. }
  96. #drupal-off-canvas-wrapper .dropbutton-toggle button:focus {
  97. outline: solid 2px var(--off-canvas-dropbutton-focus-outline-color);
  98. outline-offset: -2px;
  99. }
  100. #drupal-off-canvas-wrapper .dropbutton-toggle button::before {
  101. display: block;
  102. width: 0.375rem;
  103. height: 0.375rem;
  104. content: "";
  105. transform: translateY(-25%) rotate(45deg);
  106. border-right: solid 2px var(--off-canvas-dropbutton-text-color);
  107. border-bottom: solid 2px var(--off-canvas-dropbutton-text-color);
  108. }
  109. #drupal-off-canvas-wrapper .dropbutton-toggle button:dir(rtl) {
  110. border-radius: var(--off-canvas-dropbutton-border-radius) 0 0 var(--off-canvas-dropbutton-border-radius);
  111. }
  112. /* This is the first
  113. element in the list of actions. */
  114. #drupal-off-canvas-wrapper .dropbutton-action:first-child {
  115. margin-inline-end: 2px;
  116. border: solid var(--off-canvas-dropbutton-border-width) var(--off-canvas-dropbutton-border-color);
  117. border-radius: var(--off-canvas-dropbutton-border-radius) 0 0 var(--off-canvas-dropbutton-border-radius); /* LTR */
  118. background: var(--off-canvas-dropbutton-primary-background-color);
  119. }
  120. #drupal-off-canvas-wrapper .dropbutton-action:first-child:dir(rtl) {
  121. border: solid var(--off-canvas-dropbutton-border-width) var(--off-canvas-dropbutton-border-color);
  122. border-radius: 0 var(--off-canvas-dropbutton-border-radius) var(--off-canvas-dropbutton-border-radius) 0;
  123. }
  124. #drupal-off-canvas-wrapper .dropbutton-action a {
  125. display: flex;
  126. align-items: center;
  127. min-height: var(--off-canvas-dropbutton-height);
  128. margin-bottom: -2px;
  129. padding: 0 0.5625rem;
  130. -webkit-text-decoration: none;
  131. text-decoration: none;
  132. color: var(--off-canvas-dropbutton-text-color);
  133. font-weight: 600;
  134. }
  135. #drupal-off-canvas-wrapper .dropbutton-action a:hover {
  136. color: var(--off-canvas-dropbutton-text-color);
  137. }
  138. #drupal-off-canvas-wrapper .dropbutton-action a:focus {
  139. outline: solid 2px var(--off-canvas-dropbutton-focus-outline-color);
  140. outline-offset: -1px; /* Overlap parent container by 1px. */
  141. }
  142. /* These are the
  143. elements other than the first. */
  144. #drupal-off-canvas-wrapper .secondary-action {
  145. visibility: hidden;
  146. width: calc(100% + var(--off-canvas-dropbutton-height));
  147. margin-top: var(--off-canvas-dropbutton-border-width);
  148. border-right: var(--off-canvas-dropbutton-border-width) solid var(--off-canvas-dropbutton-border-color);
  149. border-left: var(--off-canvas-dropbutton-border-width) solid var(--off-canvas-dropbutton-border-color);
  150. background-color: var(--off-canvas-dropbutton-primary-background-color);
  151. }
  152. #drupal-off-canvas-wrapper .secondary-action:last-child {
  153. border-bottom: var(--off-canvas-dropbutton-border-width) solid var(--off-canvas-dropbutton-border-color);
  154. }
  155. #drupal-off-canvas-wrapper .secondary-action a:hover {
  156. color: var(--off-canvas-dropbutton-text-color-hover);
  157. background-color: var(--off-canvas-dropbutton-secondary-background-color);
  158. }

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