admin-toolbar.css

Same filename in other branches
  1. 11.x 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. mask-repeat: no-repeat;
  159. mask-position: center center;
  160. mask-size: 100% auto;
  161. 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");
  162. }
  163. [data-admin-toolbar-transitions] .admin-toolbar__expand-button::before {
  164. opacity: 1;
  165. }
  166. [dir="rtl"] .admin-toolbar__expand-button::before {
  167. transform: rotate(180deg);
  168. }
  169. @media (forced-colors: active) {
  170. .admin-toolbar__expand-button::before {
  171. background: canvastext;
  172. }
  173. }
  174. .admin-toolbar__expand-button[aria-expanded="true"]::before {
  175. transform: rotate(180deg);
  176. }
  177. [dir="rtl"] .admin-toolbar__expand-button[aria-expanded="true"]::before {
  178. transform: none;
  179. }
  180. @media (min-width: 64rem) {
  181. .admin-toolbar__expand-button {
  182. display: flex;
  183. }
  184. }
  185. .admin-toolbar__header {
  186. position: sticky;
  187. z-index: var(--admin-toolbar-z-index-header);
  188. inset-block-start: 0;
  189. display: flex;
  190. align-items: center;
  191. justify-content: space-between;
  192. margin-block-start: calc(var(--admin-toolbar-sidebar-header) * -1);
  193. padding-block-start: var(--admin-toolbar-space-16);
  194. background-color: var(--admin-toolbar-color-white);
  195. }
  196. .admin-toolbar__header + .toolbar-block {
  197. margin-block-start: calc(var(--admin-toolbar-space-10) * -1);
  198. }
  199. @media (min-width: 64rem) {
  200. .admin-toolbar__header + .toolbar-block {
  201. margin-block-start: 0;
  202. }
  203. }
  204. @media (min-width: 64rem) {
  205. .admin-toolbar__header:not(:has(.admin-toolbar__logo)) {
  206. display: none;
  207. }
  208. }
  209. @media (min-width: 64rem) {
  210. .admin-toolbar__header {
  211. position: static;
  212. align-items: start;
  213. margin-block-start: revert;
  214. padding-block-start: revert;
  215. padding-block-end: 0;
  216. }
  217. }
  218. .admin-toolbar__item {
  219. flex: 1 0 100%;
  220. }
  221. .admin-toolbar__logo {
  222. display: inline-flex;
  223. overflow: hidden;
  224. border-radius: var(--admin-toolbar-space-8);
  225. }
  226. .admin-toolbar__logo:hover {
  227. background-color: transparent;
  228. }
  229. .admin-toolbar__logo img {
  230. display: block;
  231. }
  232. /**
  233. * Scroll wrapper for Mobile.
  234. */
  235. .admin-toolbar__scroll-wrapper {
  236. display: flex;
  237. overflow-y: auto;
  238. flex-direction: column;
  239. height: 100%;
  240. 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));
  241. background-color: var(--admin-toolbar-color-white);
  242. background-repeat: no-repeat;
  243. background-attachment: local, scroll;
  244. background-position-y: 3rem;
  245. background-size:
  246. 100% 2.5rem,
  247. 100% 1rem;
  248. }
  249. @media (min-width: 64rem) {
  250. .admin-toolbar__scroll-wrapper {
  251. display: contents;
  252. overflow-y: unset;
  253. background: none;
  254. }
  255. }
  256. /**
  257. * Content region.
  258. * Region where most of the content will be printed.
  259. */
  260. .admin-toolbar__content {
  261. display: grid;
  262. gap: var(--admin-toolbar-space-12);
  263. padding-block: var(--admin-toolbar-sidebar-header) var(--admin-toolbar-space-16);
  264. padding-inline: var(--admin-toolbar-space-16);
  265. border-inline-end: 1px solid var(--admin-toolbar-color-gray-100);
  266. }
  267. @media (min-width: 64rem) {
  268. .admin-toolbar__content {
  269. display: flex;
  270. overflow-x: hidden;
  271. overflow-y: auto;
  272. flex-direction: column;
  273. flex-grow: 1;
  274. padding-block-start: var(--admin-toolbar-space-16);
  275. background:
  276. linear-gradient(var(--admin-toolbar-color-white) 30%, var(--admin-toolbar-color-white)),
  277. linear-gradient(var(--admin-toolbar-color-white), var(--admin-toolbar-color-white) 80%) 0 100%,
  278. radial-gradient(farthest-side at 50% 0, var(--admin-toolbar-color-shadow-15), var(--admin-toolbar-color-shadow-0)),
  279. radial-gradient(farthest-side at 50% 100%, var(--admin-toolbar-color-shadow-15), var(--admin-toolbar-color-shadow-0)) 0 100%;
  280. background-color: var(--admin-toolbar-color-white);
  281. background-repeat: no-repeat;
  282. background-attachment: local, local, scroll, scroll;
  283. background-size:
  284. 100% 2.5rem,
  285. 100% 2.5rem,
  286. 100% 1rem,
  287. 100% 1rem;
  288. }
  289. }
  290. /**
  291. * Sticky bottom region.
  292. * Region with less used items and button for collapse.
  293. */
  294. .admin-toolbar__footer {
  295. z-index: var(--admin-toolbar-z-index-footer);
  296. display: grid;
  297. gap: var(--admin-toolbar-space-16);
  298. margin-block-start: auto;
  299. padding: var(--admin-toolbar-space-16);
  300. border-block-start: 1px solid var(--admin-toolbar-color-gray-200);
  301. border-inline-end: 1px solid var(--admin-toolbar-color-gray-100);
  302. }
  303. @media (min-width: 64rem) {
  304. .admin-toolbar__footer {
  305. --admin-toolbar-z-index-footer: -1;
  306. position: sticky;
  307. bottom: 0;
  308. background-color: var(--admin-toolbar-color-white);
  309. }
  310. }
  311. /**
  312. * Sidebar toggle.
  313. */
  314. .admin-toolbar__toggle {
  315. display: none;
  316. }
  317. @media (min-width: 64rem) {
  318. .admin-toolbar__toggle {
  319. display: flex;
  320. }
  321. }
  322. [data-admin-toolbar="expanded"] :is([data-drupal-tooltip]:hover + .admin-toolbar__tooltip),
  323. [data-admin-toolbar="expanded"] :is([data-drupal-tooltip]:focus + .admin-toolbar__tooltip) {
  324. display: none;
  325. }
  326. /**
  327. * Element is used to overlay the content when Toolbar is expanded in smaller devices.
  328. * It is created in the template templates/navigation.html.twig.
  329. */
  330. .admin-toolbar-overlay {
  331. position: fixed;
  332. z-index: var(--admin-toolbar-z-index-overlay);
  333. inset-block-start: 0;
  334. inset-inline-start: 0;
  335. display: none;
  336. width: 100vw;
  337. height: 100vh;
  338. background-color: rgba(0, 0, 0, 0.14);
  339. }
  340. :where([data-admin-toolbar="expanded"]) .admin-toolbar-overlay {
  341. display: block;
  342. }
  343. @media (min-width: 64rem) {
  344. .admin-toolbar-overlay {
  345. display: none;
  346. }
  347. }

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