dropbutton.css

Same filename in this branch
  1. 10 core/profiles/demo_umami/themes/umami/css/classy/components/dropbutton.css
  2. 10 core/misc/dialog/off-canvas/css/dropbutton.css
  3. 10 core/misc/dropbutton/dropbutton.css
  4. 10 core/themes/stable9/css/core/dropbutton/dropbutton.css
  5. 10 core/themes/claro/css/components/dropbutton.css
  6. 10 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. 11.x core/profiles/demo_umami/themes/umami/css/classy/components/dropbutton.css
  19. 11.x core/misc/dialog/off-canvas/css/dropbutton.css
  20. 11.x core/misc/dropbutton/dropbutton.css
  21. 11.x core/themes/olivero/css/components/dropbutton.css
  22. 11.x core/themes/stable9/css/core/dropbutton/dropbutton.css
  23. 11.x core/themes/claro/css/components/dropbutton.css
  24. 11.x core/themes/starterkit_theme/css/components/dropbutton.css

Dropbutton styles.

File

core/themes/olivero/css/components/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. * Dropbutton styles.
  10. */
  11. .dropbutton-wrapper {
  12. --dropbutton--height: var(--sp1-5);
  13. --dropbutton--secondary-bg-color: var(--color--white);
  14. --dropbutton--active-bg-color: var(--color--gray-90);
  15. --dropbutton--outline-color: var(--color--primary-40); /* Minimum 3:1 contrast ratio against --dropbutton--active-bg-color and --dropbutton--secondary-bg-color. */
  16. --dropbutton--border-radius: var(--border-radius);
  17. --dropbutton--font-size: var(--font-size-s);
  18. --dropbutton--text-color: var(--color-text-neutral-medium); /* Minimum 4.5:1 contrast ratio against --dropbutton--active-bg-color and --dropbutton--secondary-bg-color. */
  19. --dropbutton--text-hover-color: var(--color-text-primary-medium); /* Minimum 4.5:1 contrast ratio against --dropbutton--active-bg-color and --dropbutton--secondary-bg-color. */
  20. }
  21. .dropbutton-wrapper.open {
  22. position: relative;
  23. z-index: 100; /* Ensure this appears above all other dropbuttons. */
  24. filter: drop-shadow(0 2px 2px var(--dropbutton--active-bg-color));
  25. }
  26. .dropbutton-widget {
  27. position: relative;
  28. width: max-content;
  29. height: var(--dropbutton--height);
  30. padding-inline-end: var(--dropbutton--height);
  31. border-radius: var(--dropbutton--border-radius);
  32. }
  33. .dropbutton-single .dropbutton-widget {
  34. padding-inline-end: 0;
  35. }
  36. .dropbutton-wrapper.open .dropbutton-widget {
  37. border-radius: var(--dropbutton--border-radius) var(--dropbutton--border-radius) 0 0;
  38. }
  39. .dropbutton {
  40. height: var(--dropbutton--height);
  41. margin-block: 0;
  42. margin-inline-start: 0;
  43. padding-inline-start: 0;
  44. list-style: none;
  45. font-size: var(--dropbutton--font-size);
  46. }
  47. /* This is the button that expands/collapses the secondary options. */
  48. .dropbutton-toggle button {
  49. position: absolute;
  50. top: 0;
  51. inset-inline-end: 0;
  52. display: flex;
  53. align-items: center;
  54. justify-content: center;
  55. width: var(--dropbutton--height);
  56. height: var(--dropbutton--height);
  57. padding: 0;
  58. cursor: pointer;
  59. border-color: transparent;
  60. border-radius: 0 var(--border-radius) var(--border-radius) 0; /* LTR */
  61. background: var(--dropbutton--active-bg-color);
  62. }
  63. .dropbutton-toggle button:focus {
  64. outline: solid 2px var(--dropbutton--outline-color);
  65. outline-offset: -2px;
  66. }
  67. .dropbutton-toggle button::before {
  68. display: block;
  69. width: var(--sp0-5);
  70. height: var(--sp0-5);
  71. content: "";
  72. transform: translateY(-25%) rotate(45deg);
  73. border-right: solid 2px var(--dropbutton--outline-color);
  74. border-bottom: solid 2px var(--dropbutton--outline-color);
  75. }
  76. .dropbutton-wrapper.open :is(.dropbutton-toggle button::before) {
  77. transform: translateY(25%) rotate(225deg);
  78. }
  79. .dropbutton-toggle button:dir(rtl) {
  80. border-radius: var(--dropbutton--border-radius) 0 0 var(--dropbutton--border-radius);
  81. }
  82. /* This is the first
  83. element in the list of actions. */
  84. .dropbutton-action:first-child {
  85. margin-inline-end: 2px;
  86. border: solid 1px transparent;
  87. border-radius: var(--dropbutton--border-radius) 0 0 var(--dropbutton--border-radius); /* LTR */
  88. background: var(--dropbutton--active-bg-color);
  89. }
  90. .dropbutton-action:first-child:dir(rtl) {
  91. border: solid 1px transparent;
  92. border-radius: 0 var(--dropbutton--border-radius) var(--dropbutton--border-radius) 0;
  93. }
  94. .dropbutton-action a {
  95. display: flex;
  96. align-items: center;
  97. margin-bottom: -2px; /* Account for borders. */
  98. padding: 0 0.5625rem;
  99. -webkit-text-decoration: none;
  100. text-decoration: none;
  101. color: var(--dropbutton--text-color);
  102. font-weight: 600;
  103. }
  104. .dropbutton-action a:hover {
  105. color: inherit;
  106. }
  107. .dropbutton-action a:focus {
  108. outline: solid 2px var(--dropbutton--outline-color);
  109. outline-offset: -1px; /* Overlap parent container by 1px. */
  110. }
  111. /* Special rules if there is only one action. */
  112. .dropbutton-single .dropbutton-action:first-child {
  113. border-right: solid 1px transparent; /* LTR */
  114. border-radius: var(--dropbutton--border-radius);
  115. }
  116. .dropbutton-single .dropbutton-action:first-child:dir(rtl) {
  117. border: solid 1px transparent;
  118. }
  119. .dropbutton-single .dropbutton-action a {
  120. justify-content: center;
  121. }
  122. /* These are the
  123. elements other than the first. */
  124. .secondary-action {
  125. visibility: hidden;
  126. width: calc(100% + var(--dropbutton--height));
  127. border-right: 1px solid var(--dropbutton--active-bg-color);
  128. border-left: 1px solid var(--dropbutton--active-bg-color);
  129. background: var(--dropbutton--secondary-bg-color);
  130. }
  131. .secondary-action:last-child {
  132. border-bottom: 1px solid var(--dropbutton--active-bg-color);
  133. }
  134. .secondary-action a:hover {
  135. color: var(--dropbutton--text-hover-color);
  136. }
  137. .dropbutton-wrapper.open .secondary-action {
  138. visibility: visible;
  139. }

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