header-navigation.css

Same filename and directory in other branches
  1. 10 core/themes/olivero/css/components/header-navigation.css
  2. 11.x core/themes/olivero/css/components/header-navigation.css
  3. 9 core/themes/olivero/css/components/header-navigation.css

Navigation in header.

File

core/themes/olivero/css/components/header-navigation.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. * Navigation in header.
  10. */
  11. .header-nav {
  12. position: fixed;
  13. z-index: 501; /* Appear above overlay and contextual links in header. */
  14. inset-block-start: 0;
  15. inset-inline-start: 100%;
  16. visibility: hidden;
  17. overflow: auto;
  18. /* Ensure that header nav not use additional space and force system branding
  19. * block text to unnecessarily wrap. */
  20. flex-basis: max-content;
  21. width: 100%;
  22. max-width: var(--mobile-nav-width);
  23. height: 100%;
  24. padding-block: 0 var(--sp);
  25. padding-inline-start: var(--sp);
  26. padding-inline-end: var(--sp);
  27. /* Create room for the "close" button. We cannot use margin because the
  28. * mobile navigation needs to slide beneath the button, but we also cannot
  29. * use padding because that would enable the button to scroll out of the
  30. * viewport on short screens. */
  31. border-block-start: solid var(--color--white) calc(var(--sp3) + var(--drupal-displace-offset-top, 0px));
  32. background-color: var(--color--white);
  33. box-shadow: 0 0 72px rgb(0, 0, 0, 0.1);
  34. /* When Navigation module's mobile top bar is present, add padding to ensure no overlap. */
  35. body:has(> .admin-toolbar-control-bar)
  36. }
  37. &.is-active {
  38. visibility: visible;
  39. transform: translateX(calc(-100% - var(--drupal-displace-offset-right, 0px))); /* LTR */
  40. &:dir(rtl) {
  41. transform: translateX(calc(100% + var(--drupal-displace-offset-left, 0px)));
  42. }
  43. }
  44. @media (min-width: 31.25rem) {
  45. border-top-width: calc(var(--sp5) + var(--drupal-displace-offset-top, 0px));
  46. }
  47. @media (min-width: 43.75rem) {
  48. padding-block-end: var(--sp3);
  49. padding-inline-start: var(--sp3);
  50. border-top-width: calc(var(--sp7) + var(--drupal-displace-offset-top, 0px));
  51. }
  52. @media (min-width: 62.5rem) {
  53. grid-column: 5 / 14;
  54. }
  55. /*
  56. * Ensure top border has the same color as the background when in forced colors.
  57. */
  58. @media (forced-colors: active) {
  59. border-top-color: canvas;
  60. }
  61. }
  62. /*
  63. * Only apply transition styles when JS is loaded. This
  64. * works around https://bugs.chromium.org/p/chromium/issues/detail?id=332189
  65. */
  66. html.js .header-nav {
  67. transition:
  68. visibility 0.2s,
  69. transform 0.2s;
  70. }
  71. body:not(.is-always-mobile-nav) .header-nav {
  72. @media (min-width: 75rem) {
  73. position: static;
  74. display: flex;
  75. visibility: visible;
  76. overflow: visible;
  77. grid-column: 5 / 15;
  78. align-items: center;
  79. justify-content: flex-end;
  80. max-width: none;
  81. height: var(--header-height-wide-when-fixed);
  82. margin-block-start: auto;
  83. padding-block: 0;
  84. padding-inline-start: 0;
  85. padding-inline-end: 0;
  86. transition: transform 0.2s;
  87. transform: none;
  88. border-block-start: 0;
  89. box-shadow: none;
  90. }
  91. }
  92. body.is-always-mobile-nav {
  93. & .header-nav {
  94. @media (min-width: 75rem) {
  95. overflow: auto;
  96. max-width: calc((7 * (var(--grid-col-width) + var(--grid-gap))));
  97. padding-inline-end: var(--sp);
  98. transition:
  99. transform 0.2s,
  100. visibility 0.2s;
  101. border-top-width: calc(var(--drupal-displace-offset-top, 0px) + var(--sp11));
  102. }
  103. @media (min-width: 90rem) {
  104. max-width: calc(100vw - (var(--max-width) + var(--content-left)) + ((7 * (var(--grid-col-width) + var(--grid-gap)))));
  105. padding-inline-end: calc(100vw - (var(--max-width) + var(--content-left) - var(--sp)));
  106. }
  107. }
  108. }
  109. .header-nav-overlay {
  110. position: fixed;
  111. z-index: 101;
  112. inset-block-start: 0;
  113. inset-inline-start: 0;
  114. display: none;
  115. width: 100%;
  116. height: 100vh;
  117. opacity: 0.2;
  118. background: var(--color--gray-5);
  119. .is-overlay-active
  120. @media (forced-colors: active) {
  121. background: canvastext;
  122. }
  123. }

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