dropbutton.css 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/2815083
  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. height: 3rem;
  55. }
  56. /* Variants. */
  57. .js.no-touchevents .dropbutton--small {
  58. height: 2rem;
  59. }
  60. .js.no-touchevents .dropbutton--extrasmall {
  61. height: 1.5rem;
  62. }
  63. /**
  64. * First dropbutton list item.
  65. */
  66. .js .dropbutton--multiple .dropbutton__item:first-of-type {
  67. margin-right: calc(3rem + 1px); /* LTR */
  68. }
  69. [dir="rtl"].js .dropbutton--multiple .dropbutton__item:first-of-type {
  70. margin-right: 0;
  71. margin-left: calc(3rem + 1px);
  72. }
  73. /* First dropbutton list item variants */
  74. .js.no-touchevents .dropbutton--multiple.dropbutton--small .dropbutton__item:first-of-type {
  75. margin-right: calc(2rem + 1px); /* LTR */
  76. }
  77. [dir="rtl"].js.no-touchevents .dropbutton--multiple.dropbutton--small .dropbutton__item:first-of-type {
  78. margin-right: 0;
  79. margin-left: calc(2rem + 1px);
  80. }
  81. .js.no-touchevents .dropbutton--multiple.dropbutton--extrasmall .dropbutton__item:first-of-type {
  82. margin-right: calc(1.5rem + 1px); /* LTR */
  83. }
  84. [dir="rtl"].js.no-touchevents .dropbutton--multiple.dropbutton--extrasmall .dropbutton__item:first-of-type {
  85. margin-right: 0;
  86. margin-left: calc(1.5rem + 1px);
  87. }
  88. /**
  89. * Dropbutton toggler.
  90. */
  91. .dropbutton__toggle {
  92. position: absolute;
  93. z-index: 3;
  94. top: 0;
  95. right: 0; /* LTR */
  96. bottom: 0;
  97. width: 3rem;
  98. height: 3rem;
  99. border: 1px solid transparent !important; /* 1 */
  100. border-radius: 0 2px 2px 0; /* LTR */
  101. background: #d4d4d8;
  102. font-size: 1px; /* iOS Safari sets a minimum button-width based on font-size. */
  103. -webkit-appearance: none;
  104. -moz-appearance: none;
  105. appearance: none;
  106. }
  107. [dir="rtl"] .dropbutton__toggle {
  108. right: auto;
  109. left: 0;
  110. border-radius: 2px 0 0 2px;
  111. }
  112. .dropbutton__toggle::before {
  113. position: absolute;
  114. top: 50%;
  115. right: 50%;
  116. width: 0.875rem;
  117. height: 0.5625rem;
  118. content: "";
  119. transform: translate(50%, -50%) rotate(0);
  120. background: url("data:image/svg+xml,%3Csvg width='14' height='9' viewBox='0 0 14 9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.2384999,1.9384769 1.646703,0.5166019 7.0002189,5.8193359 12.353735,0.5166019 13.761938,1.9384769 7.0002189,8.635742Z' fill='%23222330'/%3E%3C/svg%3E") no-repeat center;
  121. background-size: contain;
  122. }
  123. /* Toggler states. */
  124. .dropbutton__toggle:hover {
  125. color: #222330;
  126. background-color: #c2c3ca;
  127. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  128. }
  129. .dropbutton__toggle:focus {
  130. z-index: 2;
  131. }
  132. .dropbutton__toggle:active {
  133. color: #222330;
  134. background-color: #adaeb3;
  135. }
  136. .dropbutton-wrapper.open .dropbutton__toggle::before {
  137. transform: translate(50%, -50%) rotate(180deg);
  138. }
  139. [dir="rtl"] .dropbutton-wrapper.open .dropbutton__toggle::before {
  140. transform: translate(50%, -50%) rotate(-180deg);
  141. }
  142. /* Toggler variants */
  143. .no-touchevents .dropbutton--small .dropbutton__toggle {
  144. width: 2rem;
  145. height: 2rem;
  146. }
  147. .no-touchevents .dropbutton--extrasmall .dropbutton__toggle {
  148. width: 1.5rem;
  149. height: 1.5rem;
  150. }
  151. .no-touchevents .dropbutton--small .dropbutton__toggle::before,
  152. .no-touchevents .dropbutton--extrasmall .dropbutton__toggle::before {
  153. width: 0.75rem; /* 12px */
  154. }
  155. /* High contrast. */
  156. @media screen and (-ms-high-contrast: active) {
  157. /* Default. */
  158. .dropbutton__toggle::before {
  159. width: 0.5625rem;
  160. height: 0.5625rem;
  161. margin-top: -0.19886rem;
  162. transform: translate(50%, -50%) rotate(135deg); /* LTR */
  163. border: 0.125rem solid;
  164. border-width: 0.125rem 0.125rem 0 0;
  165. background: none;
  166. }
  167. .dropbutton-wrapper.open .dropbutton__toggle::before {
  168. margin-top: 0.19886rem;
  169. transform: translate(50%, -50%) rotate(315deg);
  170. }
  171. [dir="rtl"] .dropbutton-wrapper.open .dropbutton__toggle::before {
  172. transform: translate(50%, -50%) rotate(-45deg);
  173. }
  174. /* Variants */
  175. .no-touchevents .dropbutton--small .dropbutton__toggle::before,
  176. .no-touchevents .dropbutton--extrasmall .dropbutton__toggle::before {
  177. width: 0.4375rem;
  178. height: 0.4375rem;
  179. margin-top: -0.15467rem;
  180. }
  181. .dropbutton-wrapper.open .dropbutton__toggle::before {
  182. margin-top: 0.15467rem;
  183. }
  184. }
  185. /**
  186. * Item in the first dropbutton list item (that looks like a button).
  187. *
  188. * Duplicates base button styles.
  189. */
  190. .dropbutton__item:first-of-type > * {
  191. display: inline-block;
  192. margin: 0;
  193. padding: calc(1rem - 1px) calc(1.5rem - 1px);
  194. cursor: pointer;
  195. text-align: center;
  196. text-decoration: none;
  197. color: #222330;
  198. border: 1px solid transparent !important; /* 1 */
  199. border-radius: 2px;
  200. background-color: #d4d4d8;
  201. font-size: 1rem;
  202. font-weight: 700;
  203. line-height: 1rem;
  204. -webkit-appearance: none;
  205. -moz-appearance: none;
  206. appearance: none;
  207. -webkit-font-smoothing: antialiased;
  208. }
  209. .dropbutton--multiple .dropbutton__item:first-of-type > * {
  210. padding-right: calc(1rem - 1px);
  211. padding-left: calc(1rem - 1px);
  212. }
  213. /* Variants */
  214. .no-touchevents .dropbutton__item--small:first-of-type > * {
  215. padding-top: calc(0.625rem - 1px);
  216. padding-bottom: calc(0.625rem - 1px);
  217. font-size: 0.79rem;
  218. line-height: 0.75rem;
  219. }
  220. .no-touchevents .dropbutton__item--extrasmall:first-of-type > * {
  221. padding-top: calc(0.375rem - 1px);
  222. padding-bottom: calc(0.375rem - 1px);
  223. font-size: 0.79rem;
  224. line-height: 0.75rem;
  225. }
  226. .dropbutton__item:first-of-type > *:hover,
  227. .dropbutton__item:first-of-type > .button:hover {
  228. text-decoration: none;
  229. color: #222330;
  230. background-color: #c2c3ca;
  231. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  232. }
  233. .dropbutton__item:first-of-type > *:focus:hover,
  234. .dropbutton__item:first-of-type > .button:focus:hover {
  235. box-shadow: 0 0 0 2px #fff, 0 0 0 5px #26a769;
  236. }
  237. .dropbutton__item:first-of-type > *:focus {
  238. text-decoration: none;
  239. }
  240. .dropbutton__item:first-of-type > *:active {
  241. color: #222330;
  242. background-color: #adaeb3;
  243. }
  244. .dropbutton--multiple .dropbutton__item:first-of-type > * {
  245. position: relative;
  246. z-index: 3;
  247. }
  248. .dropbutton--multiple .dropbutton__item:first-of-type > *:focus {
  249. z-index: 2;
  250. }
  251. .js .dropbutton--multiple .dropbutton__item:first-of-type > * {
  252. border-radius: 2px 0 0 2px; /* LTR */
  253. }
  254. [dir="rtl"].js .dropbutton--multiple .dropbutton__item:first-of-type > * {
  255. border-radius: 0 2px 2px 0;
  256. }
  257. .dropbutton > .dropbutton__item > a,
  258. .dropbutton > .dropbutton__item > .button {
  259. display: block;
  260. box-sizing: border-box;
  261. width: 100%;
  262. margin: 0;
  263. text-align: left; /* LTR */
  264. }
  265. [dir="rtl"] .dropbutton > .dropbutton__item > a,
  266. [dir="rtl"] .dropbutton > .dropbutton__item > .button {
  267. text-align: right;
  268. }
  269. .js .dropbutton-wrapper:not(.open) .dropbutton__item:first-of-type ~ .dropbutton__item {
  270. display: none;
  271. }
  272. /**
  273. * Non-first dropbutton list elements.
  274. */
  275. .dropbutton__item:first-of-type ~ .dropbutton__item {
  276. border: 1px solid #d4d4d8;
  277. border-bottom: 0;
  278. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  279. }
  280. .dropbutton__item:first-of-type ~ .dropbutton__item ~ .dropbutton__item {
  281. border-top: 0;
  282. }
  283. .dropbutton__item ~ .dropbutton__item:last-child {
  284. border-bottom: 1px solid #d4d4d8;
  285. border-radius: 0 0 2px 2px;
  286. }
  287. /**
  288. * Dropbutton items of non-first dropbutton list elements.
  289. */
  290. .dropbutton__item:first-of-type ~ .dropbutton__item > a,
  291. .dropbutton__item:first-of-type ~ .dropbutton__item > .button {
  292. position: relative;
  293. padding: calc(1rem - 1px);
  294. text-decoration: none;
  295. color: #545560;
  296. border: 1px solid transparent !important; /* 1 */
  297. border-radius: 2px;
  298. background: #fff;
  299. box-shadow: 0;
  300. font-size: 1rem;
  301. font-weight: normal;
  302. line-height: 1rem;
  303. -webkit-font-smoothing: antialiased;
  304. }
  305. /**
  306. * Set the inherited button border color to transparent for high contrast mode.
  307. */
  308. @media screen and (-ms-high-contrast: active) {
  309. .dropbutton__item:first-of-type ~ .dropbutton__item > a,
  310. .dropbutton__item:first-of-type ~ .dropbutton__item > .button {
  311. border-color: transparent !important;
  312. }
  313. }
  314. .dropbutton__item:first-of-type ~ .dropbutton__item > a:not(:focus),
  315. .dropbutton__item:first-of-type ~ .dropbutton__item > .button:not(:focus) {
  316. z-index: 1;
  317. }
  318. /* Variants. */
  319. .no-touchevents .dropbutton__item:first-of-type ~ .dropbutton__item--small > a,
  320. .no-touchevents .dropbutton__item:first-of-type ~ .dropbutton__item--small > .button {
  321. padding-top: 0.625rem;
  322. padding-bottom: 0.625rem;
  323. font-size: 0.79rem;
  324. line-height: 0.75rem;
  325. }
  326. .no-touchevents .dropbutton__item:first-of-type ~ .dropbutton__item--extrasmall > a,
  327. .no-touchevents .dropbutton__item:first-of-type ~ .dropbutton__item--extrasmall > .button {
  328. padding-top: 0.375rem;
  329. padding-bottom: 0.375rem;
  330. font-size: 0.79rem;
  331. line-height: 0.75rem;
  332. }
  333. /* States. */
  334. .dropbutton__item > *:focus {
  335. position: relative;
  336. z-index: 3;
  337. }
  338. .dropbutton__item:first-of-type ~ .dropbutton__item > *:hover {
  339. color: #222330;
  340. background: #f3f4f9;
  341. }
  342. .dropbutton__item > .button:not(:focus) {
  343. box-shadow: none;
  344. }
  345. .dropbutton__item:first-of-type ~ .dropbutton__item > *:focus {
  346. border-color: #26a769 !important; /* 1 */
  347. box-shadow: inset 0 0 0 1px #26a769, 0 0 0 1px #26a769;
  348. }