dropbutton.css

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

Dropbutton styles.

1. Transparent border is needed for high contrast mode. The border-width has to be set with !important to render borders with the defined width in high contrast mode Firefox.

File

core/themes/claro/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. * 1. Transparent border is needed for high contrast mode. The border-width has
  12. * to be set with !important to render borders with the defined width in high
  13. * contrast mode Firefox.
  14. */
  15. :root {
  16. /**
  17. * Dropbutton
  18. */
  19. /* Variant variables: small. */
  20. /* Variant variables: extra small. */
  21. }
  22. .dropbutton-wrapper {
  23. display: inline-flex;
  24. border-radius: 2px;
  25. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  26. }
  27. .form-actions .dropbutton-wrapper {
  28. margin: 0.5rem 1rem 0.5rem 0;
  29. }
  30. [dir="rtl"] .form-actions .dropbutton-wrapper {
  31. margin-right: 0;
  32. margin-left: 1rem;
  33. }
  34. .dropbutton-widget {
  35. position: relative;
  36. flex: 1 1 auto;
  37. }
  38. .js .dropbutton-wrapper.open .dropbutton-widget {
  39. z-index: 100;
  40. }
  41. /**
  42. * Dropbutton list.
  43. */
  44. .dropbutton {
  45. display: block;
  46. overflow: visible;
  47. margin: 0;
  48. list-style: none;
  49. }
  50. [dir="rtl"] .dropbutton {
  51. margin: 0;
  52. }
  53. .js .dropbutton {
  54. min-width: 6rem; /* Help mitigate long dropbutton text from obscuring other dropbuttons. */
  55. height: 3rem;
  56. }
  57. .js .dropbutton-widget {
  58. border-radius: 2px;
  59. background-color: #d3d4d9;
  60. }
  61. [dir="ltr"] .js .dropbutton-action {
  62. border-right: 1px solid white;
  63. }
  64. [dir="rtl"] .js .dropbutton-action {
  65. border-left: 1px solid white;
  66. }
  67. /* Variants. */
  68. .js.no-touchevents .dropbutton--small {
  69. height: 2rem;
  70. }
  71. .js.no-touchevents .dropbutton--extrasmall {
  72. height: 1.5rem;
  73. }
  74. /**
  75. * First dropbutton list item.
  76. */
  77. .js .dropbutton--multiple .dropbutton__item:first-of-type {
  78. margin-right: calc(3rem + 1px); /* LTR */
  79. }
  80. [dir="rtl"].js .dropbutton--multiple .dropbutton__item:first-of-type {
  81. margin-right: 0;
  82. margin-left: calc(3rem + 1px);
  83. }
  84. /* First dropbutton list item variants */
  85. .js.no-touchevents .dropbutton--multiple.dropbutton--small .dropbutton__item:first-of-type {
  86. margin-right: calc(2rem + 1px); /* LTR */
  87. }
  88. [dir="rtl"].js.no-touchevents .dropbutton--multiple.dropbutton--small .dropbutton__item:first-of-type {
  89. margin-right: 0;
  90. margin-left: calc(2rem + 1px);
  91. }
  92. .js.no-touchevents .dropbutton--multiple.dropbutton--extrasmall .dropbutton__item:first-of-type {
  93. margin-right: calc(1.5rem + 1px); /* LTR */
  94. }
  95. [dir="rtl"].js.no-touchevents .dropbutton--multiple.dropbutton--extrasmall .dropbutton__item:first-of-type {
  96. margin-right: 0;
  97. margin-left: calc(1.5rem + 1px);
  98. }
  99. /**
  100. * Dropbutton toggler.
  101. */
  102. .dropbutton__toggle {
  103. border: 1px solid transparent !important;
  104. }
  105. .dropbutton__toggle {
  106. position: absolute;
  107. z-index: 3;
  108. top: 0;
  109. right: 0; /* LTR */
  110. bottom: 0;
  111. width: 3rem;
  112. height: 3rem; /* 1 */
  113. border-radius: 0 2px 2px 0; /* LTR */
  114. background: #d3d4d9;
  115. font-size: 1px; /* iOS Safari sets a minimum button-width based on font-size. */
  116. -webkit-appearance: none;
  117. appearance: none;
  118. }
  119. [dir="rtl"] .dropbutton__toggle {
  120. right: auto;
  121. left: 0;
  122. border-radius: 2px 0 0 2px;
  123. }
  124. .dropbutton__toggle::before {
  125. position: absolute;
  126. top: 50%;
  127. right: 50%;
  128. width: 0.875rem;
  129. height: 0.5625rem;
  130. content: "";
  131. transform: translate(50%, -50%) rotate(0);
  132. background: url("data:image/svg+xml,%3csvg width='14' height='9' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M.238 1.938L1.647.517 7 5.819 12.354.517l1.408 1.421L7 8.636z' fill='%23000f33'/%3e%3c/svg%3e") no-repeat center;
  133. background-size: contain;
  134. }
  135. /* Toggler states. */
  136. .dropbutton__toggle:hover {
  137. color: #232429;
  138. background-color: #c1c2c7;
  139. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  140. }
  141. .dropbutton__toggle:focus {
  142. z-index: 2;
  143. }
  144. .dropbutton__toggle:active {
  145. color: #232429;
  146. background-color: #adaeb3;
  147. }
  148. .dropbutton-wrapper.open .dropbutton__toggle::before {
  149. transform: translate(50%, -50%) rotate(180deg);
  150. }
  151. [dir="rtl"] .dropbutton-wrapper.open .dropbutton__toggle::before {
  152. transform: translate(50%, -50%) rotate(-180deg);
  153. }
  154. /* Toggler variants */
  155. .no-touchevents .dropbutton--small .dropbutton__toggle {
  156. width: 2rem;
  157. height: 2rem;
  158. }
  159. .no-touchevents .dropbutton--extrasmall .dropbutton__toggle {
  160. width: 1.5rem;
  161. height: 1.5rem;
  162. }
  163. .no-touchevents .dropbutton--small .dropbutton__toggle::before,
  164. .no-touchevents .dropbutton--extrasmall .dropbutton__toggle::before {
  165. width: 0.75rem; /* 12px */
  166. }
  167. /* High contrast. */
  168. @media (-ms-high-contrast: active), (forced-colors: active) {
  169. /* Default. */
  170. .dropbutton__toggle::before {
  171. width: 0.5625rem;
  172. height: 0.5625rem;
  173. margin-top: -0.19886rem;
  174. transform: translate(50%, -50%) rotate(135deg); /* LTR */
  175. border: 0.125rem solid;
  176. border-width: 0.125rem 0.125rem 0 0;
  177. background: none;
  178. }
  179. .dropbutton-wrapper.open .dropbutton__toggle::before {
  180. margin-top: 0.19886rem;
  181. transform: translate(50%, -50%) rotate(315deg);
  182. }
  183. [dir="rtl"] .dropbutton-wrapper.open .dropbutton__toggle::before {
  184. transform: translate(50%, -50%) rotate(-45deg);
  185. }
  186. /* Variants */
  187. .no-touchevents .dropbutton--small .dropbutton__toggle::before,
  188. .no-touchevents .dropbutton--extrasmall .dropbutton__toggle::before {
  189. width: 0.4375rem;
  190. height: 0.4375rem;
  191. margin-top: -0.15467rem;
  192. }
  193. .dropbutton-wrapper.open .dropbutton__toggle::before {
  194. margin-top: 0.15467rem;
  195. }
  196. }
  197. /**
  198. * Item in the first dropbutton list item (that looks like a button).
  199. *
  200. * Duplicates base button styles.
  201. */
  202. .dropbutton__item:first-of-type > * {
  203. border: 1px solid transparent !important;
  204. }
  205. .dropbutton__item:first-of-type > * {
  206. display: inline-block;
  207. margin: 0;
  208. padding: calc(1rem - 1px) calc(1.5rem - 1px);
  209. cursor: pointer;
  210. text-align: center;
  211. text-decoration: none;
  212. color: #232429; /* 1 */
  213. border-radius: 2px;
  214. background-color: #d3d4d9;
  215. font-size: 1rem;
  216. font-weight: 700;
  217. line-height: 1rem;
  218. -webkit-appearance: none;
  219. appearance: none;
  220. -webkit-font-smoothing: antialiased;
  221. }
  222. .dropbutton--multiple .dropbutton__item:first-of-type > * {
  223. padding-right: calc(1rem - 1px);
  224. padding-left: calc(1rem - 1px);
  225. }
  226. /* Variants */
  227. .no-touchevents .dropbutton--small .dropbutton__item:first-of-type > * {
  228. padding-top: calc(0.625rem - 1px);
  229. padding-bottom: calc(0.625rem - 1px);
  230. font-size: 0.79rem;
  231. line-height: 0.75rem;
  232. }
  233. .no-touchevents .dropbutton--extrasmall .dropbutton__item:first-of-type > * {
  234. padding-top: calc(0.375rem - 1px);
  235. padding-bottom: calc(0.375rem - 1px);
  236. font-size: 0.79rem;
  237. line-height: 0.75rem;
  238. }
  239. .dropbutton__item:first-of-type > *:hover,
  240. .dropbutton__item:first-of-type > .button:hover {
  241. text-decoration: none;
  242. color: #232429;
  243. background-color: #c1c2c7;
  244. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  245. }
  246. .dropbutton__item:first-of-type > *:focus:hover,
  247. .dropbutton__item:first-of-type > .button:focus:hover {
  248. box-shadow: 0 0 0 2px #fff, 0 0 0 5px #26a769;
  249. }
  250. .dropbutton__item:first-of-type > *:focus {
  251. text-decoration: none;
  252. }
  253. .dropbutton__item:first-of-type > *:active {
  254. color: #232429;
  255. background-color: #adaeb3;
  256. }
  257. .dropbutton--multiple .dropbutton__item:first-of-type > * {
  258. position: relative;
  259. z-index: 3;
  260. }
  261. .dropbutton--multiple .dropbutton__item:first-of-type > *:focus {
  262. z-index: 2;
  263. }
  264. .js .dropbutton--multiple .dropbutton__item:first-of-type > * {
  265. border-radius: 2px 0 0 2px; /* LTR */
  266. }
  267. [dir="rtl"].js .dropbutton--multiple .dropbutton__item:first-of-type > * {
  268. border-radius: 0 2px 2px 0;
  269. }
  270. .dropbutton > .dropbutton__item > a,
  271. .dropbutton > .dropbutton__item > .button {
  272. display: block;
  273. box-sizing: border-box;
  274. width: 100%;
  275. margin: 0;
  276. text-align: left; /* LTR */
  277. }
  278. [dir="rtl"] .dropbutton > .dropbutton__item > a,
  279. [dir="rtl"] .dropbutton > .dropbutton__item > .button {
  280. text-align: right;
  281. }
  282. .js .dropbutton-wrapper:not(.open) .dropbutton__item:first-of-type ~ .dropbutton__item {
  283. visibility: hidden;
  284. }
  285. /**
  286. * Non-first dropbutton list elements.
  287. */
  288. .dropbutton__item:first-of-type ~ .dropbutton__item {
  289. border: 1px solid #d3d4d9;
  290. border-bottom: 0;
  291. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  292. }
  293. .dropbutton__item:first-of-type ~ .dropbutton__item ~ .dropbutton__item {
  294. border-top: 0;
  295. }
  296. .dropbutton__item ~ .dropbutton__item:last-child {
  297. border-bottom: 1px solid #d3d4d9;
  298. border-radius: 0 0 2px 2px;
  299. }
  300. /**
  301. * Dropbutton items of non-first dropbutton list elements.
  302. */
  303. .dropbutton__item:first-of-type ~ .dropbutton__item {
  304. max-width: 12.5rem;
  305. }
  306. .dropbutton__item:first-of-type ~ .dropbutton__item > a,
  307. .dropbutton__item:first-of-type ~ .dropbutton__item > .button {
  308. border: 1px solid transparent !important;
  309. }
  310. .dropbutton__item:first-of-type ~ .dropbutton__item > a,
  311. .dropbutton__item:first-of-type ~ .dropbutton__item > .button {
  312. position: relative;
  313. padding: calc(1rem - 1px);
  314. text-decoration: none;
  315. color: #55565b; /* 1 */
  316. border-radius: 2px;
  317. background: #fff;
  318. box-shadow: 0;
  319. font-size: 1rem;
  320. font-weight: normal;
  321. line-height: 1rem;
  322. -webkit-font-smoothing: antialiased;
  323. }
  324. /**
  325. * Set the inherited button border color to transparent for high contrast
  326. * mode.
  327. */
  328. @media screen and (-ms-high-contrast: active) {
  329. .dropbutton__item:first-of-type ~ .dropbutton__item > a,
  330. .dropbutton__item:first-of-type ~ .dropbutton__item > .button {
  331. border-color: transparent !important;
  332. }
  333. }
  334. .dropbutton__item:first-of-type ~ .dropbutton__item > a:not(:focus),
  335. .dropbutton__item:first-of-type ~ .dropbutton__item > .button:not(:focus) {
  336. z-index: 1;
  337. }
  338. /* Variants. */
  339. .no-touchevents .dropbutton--small .dropbutton__item:first-of-type ~ .dropbutton__item > a,
  340. .no-touchevents .dropbutton--small .dropbutton__item:first-of-type ~ .dropbutton__item > .button {
  341. padding-top: 0.625rem;
  342. padding-bottom: 0.625rem;
  343. font-size: 0.79rem;
  344. line-height: 0.75rem;
  345. }
  346. .no-touchevents .dropbutton--extrasmall .dropbutton__item:first-of-type ~ .dropbutton__item > a,
  347. .no-touchevents .dropbutton--extrasmall .dropbutton__item:first-of-type ~ .dropbutton__item > .button {
  348. padding-top: 0.375rem;
  349. padding-bottom: 0.375rem;
  350. font-size: 0.79rem;
  351. line-height: 0.75rem;
  352. }
  353. /* States. */
  354. .dropbutton__item > *:focus {
  355. position: relative;
  356. z-index: 3;
  357. }
  358. .dropbutton__item:first-of-type ~ .dropbutton__item > *:hover {
  359. color: #232429;
  360. background: #f3f4f9;
  361. }
  362. .dropbutton__item > .button:not(:focus) {
  363. box-shadow: none;
  364. }
  365. .dropbutton__item:first-of-type ~ .dropbutton__item > *:focus {
  366. border-color: #26a769 !important;
  367. }
  368. .dropbutton__item:first-of-type ~ .dropbutton__item > *:focus { /* 1 */
  369. box-shadow: inset 0 0 0 1px #26a769, 0 0 0 1px #26a769;
  370. }

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