dropbutton.pcss.css

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

Dropbutton styles.

File

core/themes/olivero/css/components/dropbutton.pcss.css

View source
  1. /**
  2. * @file
  3. * Dropbutton styles.
  4. */
  5. @import "../base/variables.pcss.css";
  6. :root {
  7. --dropbutton--height: var(--sp1-5);
  8. --dropbutton--bg-color: var(--color--gray-75);
  9. --dropbutton--border-color: var(--color--blue-20);
  10. }
  11. .dropbutton-wrapper.open {
  12. position: relative;
  13. z-index: 100; /* Ensure this appears above all other dropbuttons. */
  14. filter: drop-shadow(0 2px 2px var(--dropbutton--bg-color));
  15. }
  16. .dropbutton-widget {
  17. position: relative;
  18. width: 200px;
  19. height: var(--dropbutton--height);
  20. padding-inline-end: var(--dropbutton--height);
  21. border-radius: var(--border-radius);
  22. @supports (width: max-content) {
  23. width: max-content;
  24. }
  25. }
  26. .dropbutton-single .dropbutton-widget {
  27. padding-inline-end: 0;
  28. }
  29. .dropbutton {
  30. height: var(--dropbutton--height);
  31. margin-block: 0;
  32. margin-inline-start: 0;
  33. padding-inline-start: 0;
  34. list-style: none;
  35. font-size: var(--font-size-s);
  36. }
  37. .dropbutton-toggle button {
  38. position: absolute;
  39. top: 0;
  40. inset-inline-end: 0;
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. width: var(--dropbutton--height);
  45. height: var(--dropbutton--height);
  46. padding: 0;
  47. cursor: pointer;
  48. border-color: transparent;
  49. border-radius: 0 var(--border-radius) var(--border-radius) 0; /* LTR */
  50. background: var(--dropbutton--bg-color);
  51. &:focus {
  52. outline: solid 2px var(--dropbutton--border-color);
  53. outline-offset: -2px;
  54. }
  55. &:before {
  56. display: block;
  57. width: var(--sp0-5);
  58. height: var(--sp0-5);
  59. content: "";
  60. transform: translateY(-25%) rotate(45deg);
  61. border-right: solid 2px var(--dropbutton--border-color);
  62. border-bottom: solid 2px var(--dropbutton--border-color);
  63. }
  64. }
  65. [dir="rtl"] .dropbutton-toggle button {
  66. border-radius: var(--border-radius) 0 0 var(--border-radius);
  67. }
  68. .dropbutton-action {
  69. &:first-child {
  70. margin-inline-end: 2px;
  71. border: solid 1px transparent;
  72. border-radius: var(--border-radius) 0 0 var(--border-radius); /* LTR */
  73. background: var(--dropbutton--bg-color);
  74. }
  75. & a {
  76. display: flex;
  77. align-items: center;
  78. margin-bottom: -2px; /* Account for borders. */
  79. padding: 0 9px;
  80. text-decoration: none;
  81. color: var(--color--gray-10);
  82. font-weight: 600;
  83. &:focus {
  84. border: solid 2px var(--dropbutton--border-color);
  85. outline: 0;
  86. /* Negate specific IE rules. */
  87. @supports (outline-offset: -2px) {
  88. border: 0;
  89. outline: solid 2px var(--dropbutton--border-color);
  90. outline-offset: -1px; /* Overlap parent container by 1px. */
  91. }
  92. }
  93. }
  94. }
  95. .dropbutton-single .dropbutton-action {
  96. &:first-child {
  97. border-right: solid 1px transparent; /* LTR */
  98. border-radius: var(--border-radius);
  99. }
  100. & a {
  101. justify-content: center;
  102. }
  103. }
  104. [dir="rtl"] {
  105. & .dropbutton-action:first-child {
  106. border: solid 1px transparent;
  107. border-radius: 0 var(--border-radius) var(--border-radius) 0;
  108. }
  109. & .dropbutton-single .dropbutton-action:first-child {
  110. border: solid 1px transparent;
  111. }
  112. }
  113. .secondary-action {
  114. visibility: hidden;
  115. width: calc(100% + var(--dropbutton--height));
  116. border-right: 1px solid var(--dropbutton--bg-color);
  117. border-left: 1px solid var(--dropbutton--bg-color);
  118. background: var(--color--white);
  119. &:last-child {
  120. border-bottom: 1px solid var(--dropbutton--bg-color);
  121. }
  122. }
  123. .dropbutton-wrapper.open {
  124. & .dropbutton-toggle button:before {
  125. transform: translateY(25%) rotate(225deg);
  126. }
  127. & .dropbutton-widget {
  128. border-radius: var(--border-radius) var(--border-radius) 0 0;
  129. }
  130. & .secondary-action {
  131. visibility: visible;
  132. }
  133. }

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