admin-toolbar.css

Same filename in other branches
  1. 10 core/modules/navigation/css/components/admin-toolbar.css

Admin Toolbar styles.

File

core/modules/navigation/css/components/admin-toolbar.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. /* cspell:ignore csvg cpath */
  8. /**
  9. * @file
  10. * Admin Toolbar styles.
  11. */
  12. /**
  13. * Sidebar width is attached to the element because it's used as a
  14. * fallback value to the margin-inline-start property of the layout container.
  15. */
  16. body {
  17. --admin-toolbar-sidebar-width: calc(4.5 * var(--admin-toolbar-rem));
  18. --admin-toolbar-sidebar-header: calc(3.5 * var(--admin-toolbar-rem));
  19. }
  20. [data-admin-toolbar="expanded"] body {
  21. --admin-toolbar-sidebar-width: 80vw;
  22. }
  23. @media (min-width: 35rem) {
  24. [data-admin-toolbar="expanded"] body {
  25. --admin-toolbar-sidebar-width: calc(16.5 * var(--admin-toolbar-rem));
  26. }
  27. }
  28. /* We apply transitions after page load to avoid shifts. */
  29. [data-admin-toolbar-transitions] .admin-toolbar {
  30. transition: transform var(--admin-toolbar-transition);
  31. }
  32. @media (min-width: 64rem) {
  33. [data-admin-toolbar-transitions] .admin-toolbar {
  34. transition: width var(--admin-toolbar-transition);
  35. }
  36. :is([data-admin-toolbar-transitions] .admin-toolbar) ~ .dialog-off-canvas-main-canvas {
  37. transition: margin-inline-start var(--admin-toolbar-transition);
  38. }
  39. }
  40. /**
  41. * This zero height div has the [data-offset-left] attribute for
  42. * Drupal.displace() to measure. It purposefully does not have any transitions
  43. * because we want Drupal.displace() to measure the width immediately
  44. */
  45. .admin-toolbar__displace-placeholder {
  46. position: absolute;
  47. inset-block-start: 0;
  48. inset-inline-start: 0;
  49. }
  50. @media (min-width: 64rem) {
  51. .admin-toolbar__displace-placeholder {
  52. width: var(--admin-toolbar-sidebar-width);
  53. }
  54. }
  55. /**
  56. * The Admin toolbar component.
  57. */
  58. .admin-toolbar {
  59. position: fixed;
  60. inset-block-start: 0;
  61. inset-inline-start: 0;
  62. z-index: var(--admin-toolbar-z-index);
  63. display: flex;
  64. flex-direction: column;
  65. height: 100vh;
  66. transform: translateX(-100%);
  67. background-color: var(--admin-toolbar-color-white);
  68. font-family: var(--admin-toolbar-font-family);
  69. inline-size: calc(var(--admin-toolbar-sidebar-width) + 1px);
  70. }
  71. [dir="rtl"] .admin-toolbar {
  72. right: 0;
  73. transform: translateX(100%);
  74. }
  75. @media (min-width: 64rem) {
  76. [dir="rtl"] .admin-toolbar {
  77. transform: none;
  78. }
  79. }
  80. @media (min-width: 64rem) {
  81. .admin-toolbar ~ .dialog-off-canvas-main-canvas {
  82. margin-inline-start: var(--drupal-displace-offset-left, var(--admin-toolbar-sidebar-width));
  83. }
  84. [dir="rtl"] :is(.admin-toolbar ~ .dialog-off-canvas-main-canvas) {
  85. margin-inline-start: var(--drupal-displace-offset-right, var(--admin-toolbar-sidebar-width));
  86. }
  87. }
  88. [data-admin-toolbar="expanded"] .admin-toolbar {
  89. transform: none;
  90. }
  91. @media (min-width: 64rem) {
  92. .admin-toolbar {
  93. transform: none;
  94. }
  95. }
  96. @media only screen and (max-height: 18.75rem) {
  97. .admin-toolbar {
  98. min-height: 20rem;
  99. }
  100. }
  101. .admin-toolbar__back-button {
  102. display: none;
  103. flex-grow: 0;
  104. }
  105. .admin-toolbar:has([data-toolbar-popover-control][aria-expanded="true"]) .admin-toolbar__back-button {
  106. display: flex;
  107. }
  108. @media (min-width: 64rem) {
  109. .admin-toolbar:has([data-toolbar-popover-control][aria-expanded="true"]) .admin-toolbar__back-button {
  110. display: none;
  111. }
  112. }
  113. .admin-toolbar:has([data-toolbar-popover-control][aria-expanded="true"]) .admin-toolbar__logo {
  114. display: none;
  115. }
  116. @media (min-width: 64rem) {
  117. .admin-toolbar:has([data-toolbar-popover-control][aria-expanded="true"]) .admin-toolbar__logo {
  118. display: inline-flex;
  119. }
  120. }
  121. .admin-toolbar__close-button {
  122. flex-grow: 0;
  123. justify-self: end;
  124. margin-inline-start: auto;
  125. }
  126. @media (min-width: 64rem) {
  127. .admin-toolbar__close-button {
  128. display: none;
  129. }
  130. }
  131. .admin-toolbar__expand-button {
  132. display: none;
  133. align-items: center;
  134. justify-content: center;
  135. width: calc(2.25 * var(--admin-toolbar-rem));
  136. height: calc(2.25 * var(--admin-toolbar-rem));
  137. margin-inline-start: calc(0.125 * var(--admin-toolbar-rem));
  138. cursor: pointer;
  139. color: var(--admin-toolbar-color-gray-500);
  140. border: 1px solid var(--admin-toolbar-color-gray-300);
  141. border-radius: 50%;
  142. background-color: transparent;
  143. }
  144. .admin-toolbar__expand-button:hover {
  145. color: var(--admin-toolbar-color-blue-700);
  146. }
  147. .admin-toolbar__expand-button::before {
  148. display: block;
  149. flex-shrink: 0;
  150. width: calc(1 * var(--admin-toolbar-rem));
  151. height: calc(1 * var(--admin-toolbar-rem));
  152. content: "";
  153. transition:
  154. opacity var(--admin-toolbar-transition),
  155. transform var(--admin-toolbar-transition);
  156. opacity: 0;
  157. background-color: currentColor;
  158. -webkit-mask-repeat: no-repeat;
  159. mask-repeat: no-repeat;
  160. -webkit-mask-position: center center;
  161. mask-position: center center;
  162. -webkit-mask-size: 100% auto;
  163. mask-size: 100% auto;
  164. -webkit-mask-image: url("data:image/svg+xml,%3csvg viewBox='0 0 8 8' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5.7653 4.2653L3.2653 6.7653C3.19485 6.83575 3.0993 6.87532 2.99967 6.87532C2.90005 6.87532 2.8045 6.83575 2.73405 6.7653C2.6636 6.69485 2.62402 6.5993 2.62402 6.49967C2.62402 6.40005 2.6636 6.3045 2.73405 6.23405L4.96874 3.99999L2.73467 1.7653C2.69979 1.73042 2.67212 1.68901 2.65324 1.64343C2.63436 1.59785 2.62465 1.54901 2.62465 1.49967C2.62465 1.45034 2.63436 1.40149 2.65324 1.35592C2.67212 1.31034 2.69979 1.26893 2.73467 1.23405C2.76956 1.19917 2.81097 1.1715 2.85654 1.15262C2.90212 1.13374 2.95097 1.12402 3.0003 1.12402C3.04963 1.12402 3.09848 1.13374 3.14405 1.15262C3.18963 1.1715 3.23104 1.19917 3.26592 1.23405L5.76592 3.73405C5.80084 3.76893 5.82853 3.81036 5.84741 3.85596C5.86628 3.90157 5.87597 3.95045 5.87591 3.9998C5.87585 4.04916 5.86605 4.09802 5.84707 4.14358C5.82809 4.18914 5.8003 4.2305 5.7653 4.2653Z'/%3e%3c/svg%3e");
  165. mask-image: url("data:image/svg+xml,%3csvg viewBox='0 0 8 8' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5.7653 4.2653L3.2653 6.7653C3.19485 6.83575 3.0993 6.87532 2.99967 6.87532C2.90005 6.87532 2.8045 6.83575 2.73405 6.7653C2.6636 6.69485 2.62402 6.5993 2.62402 6.49967C2.62402 6.40005 2.6636 6.3045 2.73405 6.23405L4.96874 3.99999L2.73467 1.7653C2.69979 1.73042 2.67212 1.68901 2.65324 1.64343C2.63436 1.59785 2.62465 1.54901 2.62465 1.49967C2.62465 1.45034 2.63436 1.40149 2.65324 1.35592C2.67212 1.31034 2.69979 1.26893 2.73467 1.23405C2.76956 1.19917 2.81097 1.1715 2.85654 1.15262C2.90212 1.13374 2.95097 1.12402 3.0003 1.12402C3.04963 1.12402 3.09848 1.13374 3.14405 1.15262C3.18963 1.1715 3.23104 1.19917 3.26592 1.23405L5.76592 3.73405C5.80084 3.76893 5.82853 3.81036 5.84741 3.85596C5.86628 3.90157 5.87597 3.95045 5.87591 3.9998C5.87585 4.04916 5.86605 4.09802 5.84707 4.14358C5.82809 4.18914 5.8003 4.2305 5.7653 4.2653Z'/%3e%3c/svg%3e");
  166. }
  167. [data-admin-toolbar-transitions] .admin-toolbar__expand-button::before {
  168. opacity: 1;
  169. }
  170. [dir="rtl"] .admin-toolbar__expand-button::before {
  171. transform: rotate(180deg);
  172. }
  173. @media (forced-colors: active) {
  174. .admin-toolbar__expand-button::before {
  175. background: canvastext;
  176. }
  177. }
  178. .admin-toolbar__expand-button[aria-expanded="true"]::before {
  179. transform: rotate(180deg);
  180. }
  181. [dir="rtl"] .admin-toolbar__expand-button[aria-expanded="true"]::before {
  182. transform: none;
  183. }
  184. @media (min-width: 64rem) {
  185. .admin-toolbar__expand-button {
  186. display: flex;
  187. }
  188. }
  189. .admin-toolbar__header {
  190. position: sticky;
  191. z-index: var(--admin-toolbar-z-index-header);
  192. inset-block-start: 0;
  193. display: flex;
  194. align-items: center;
  195. justify-content: space-between;
  196. margin-block-start: calc(var(--admin-toolbar-sidebar-header) * -1);
  197. padding-block-start: var(--admin-toolbar-space-16);
  198. background-color: var(--admin-toolbar-color-white);
  199. }
  200. .admin-toolbar__header + .toolbar-block {
  201. margin-block-start: calc(var(--admin-toolbar-space-10) * -1);
  202. }
  203. @media (min-width: 64rem) {
  204. .admin-toolbar__header + .toolbar-block {
  205. margin-block-start: 0;
  206. }
  207. }
  208. @media (min-width: 64rem) {
  209. .admin-toolbar__header:not(:has(.admin-toolbar__logo)) {
  210. display: none;
  211. }
  212. }
  213. @media (min-width: 64rem) {
  214. .admin-toolbar__header {
  215. position: static;
  216. align-items: start;
  217. margin-block-start: revert;
  218. padding-block-start: revert;
  219. padding-block-end: 0;
  220. }
  221. }
  222. .admin-toolbar__item {
  223. flex: 1 0 100%;
  224. }
  225. .admin-toolbar__logo {
  226. display: inline-flex;
  227. overflow: hidden;
  228. border-radius: var(--admin-toolbar-space-8);
  229. }
  230. .admin-toolbar__logo:hover {
  231. background-color: transparent;
  232. }
  233. .admin-toolbar__logo img {
  234. display: block;
  235. max-width: var(--admin-toolbar-space-40);
  236. }
  237. /**
  238. * Scroll wrapper for Mobile.
  239. */
  240. .admin-toolbar__scroll-wrapper {
  241. display: flex;
  242. overflow-y: auto;
  243. flex-direction: column;
  244. height: 100%;
  245. background: linear-gradient(var(--admin-toolbar-color-white) 30%, var(--admin-toolbar-color-white)), radial-gradient(farthest-side at 50% 0, var(--admin-toolbar-color-shadow-15), var(--admin-toolbar-color-shadow-0));
  246. background-color: var(--admin-toolbar-color-white);
  247. background-repeat: no-repeat;
  248. background-attachment: local, scroll;
  249. background-position-y: 3rem;
  250. background-size:
  251. 100% 2.5rem,
  252. 100% 1rem;
  253. }
  254. @media (min-width: 64rem) {
  255. .admin-toolbar__scroll-wrapper {
  256. display: contents;
  257. overflow-y: unset;
  258. background: none;
  259. }
  260. }
  261. /**
  262. * Content region.
  263. * Region where most of the content will be printed.
  264. */
  265. .admin-toolbar__content {
  266. display: grid;
  267. gap: var(--admin-toolbar-space-12);
  268. padding-block: var(--admin-toolbar-sidebar-header) var(--admin-toolbar-space-16);
  269. padding-inline: var(--admin-toolbar-space-16);
  270. border-inline-end: 1px solid var(--admin-toolbar-color-gray-100);
  271. }
  272. @media (min-width: 64rem) {
  273. .admin-toolbar__content {
  274. display: flex;
  275. overflow-x: hidden;
  276. overflow-y: auto;
  277. flex-direction: column;
  278. flex-grow: 1;
  279. padding-block-start: var(--admin-toolbar-space-16);
  280. background:
  281. linear-gradient(var(--admin-toolbar-color-white) 30%, var(--admin-toolbar-color-white)),
  282. linear-gradient(var(--admin-toolbar-color-white), var(--admin-toolbar-color-white) 80%) 0 100%,
  283. radial-gradient(farthest-side at 50% 0, var(--admin-toolbar-color-shadow-15), var(--admin-toolbar-color-shadow-0)),
  284. radial-gradient(farthest-side at 50% 100%, var(--admin-toolbar-color-shadow-15), var(--admin-toolbar-color-shadow-0)) 0 100%;
  285. background-color: var(--admin-toolbar-color-white);
  286. background-repeat: no-repeat;
  287. background-attachment: local, local, scroll, scroll;
  288. background-size:
  289. 100% 2.5rem,
  290. 100% 2.5rem,
  291. 100% 1rem,
  292. 100% 1rem;
  293. }
  294. }
  295. /**
  296. * Sticky bottom region.
  297. * Region with less used items and button for collapse.
  298. */
  299. .admin-toolbar__footer {
  300. z-index: var(--admin-toolbar-z-index-footer);
  301. display: grid;
  302. gap: var(--admin-toolbar-space-4);
  303. margin-block-start: auto;
  304. padding: var(--admin-toolbar-space-16);
  305. border-block-start: 1px solid var(--admin-toolbar-color-gray-200);
  306. border-inline-end: 1px solid var(--admin-toolbar-color-gray-100);
  307. }
  308. .admin-toolbar__footer > .toolbar-block:last-of-type {
  309. margin-block-end: var(--admin-toolbar-space-12);
  310. }
  311. @media (min-width: 64rem) {
  312. .admin-toolbar__footer {
  313. --admin-toolbar-z-index-footer: -1;
  314. position: sticky;
  315. bottom: 0;
  316. background-color: var(--admin-toolbar-color-white);
  317. }
  318. }
  319. /**
  320. * Sidebar toggle.
  321. */
  322. .admin-toolbar__toggle {
  323. display: none;
  324. }
  325. @media (min-width: 64rem) {
  326. .admin-toolbar__toggle {
  327. display: flex;
  328. }
  329. }
  330. [data-admin-toolbar="expanded"] :is([data-drupal-tooltip]:hover + .admin-toolbar__tooltip),
  331. [data-admin-toolbar="expanded"] :is([data-drupal-tooltip]:focus + .admin-toolbar__tooltip) {
  332. display: none;
  333. }
  334. /**
  335. * Element is used to overlay the content when Toolbar is expanded in smaller devices.
  336. * It is created in the template templates/navigation.html.twig.
  337. */
  338. .admin-toolbar-overlay {
  339. position: fixed;
  340. z-index: var(--admin-toolbar-z-index-overlay);
  341. inset-block-start: 0;
  342. inset-inline-start: 0;
  343. display: none;
  344. width: 100vw;
  345. height: 100vh;
  346. background-color: rgba(0, 0, 0, 0.14);
  347. }
  348. :where([data-admin-toolbar="expanded"]) .admin-toolbar-overlay {
  349. display: block;
  350. }
  351. @media (min-width: 64rem) {
  352. .admin-toolbar-overlay {
  353. display: none;
  354. }
  355. }

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