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. &.is-active {
  35. visibility: visible;
  36. transform: translateX(calc(-100% - var(--drupal-displace-offset-right, 0px))); /* LTR */
  37. &:dir(rtl) {
  38. transform: translateX(calc(100% + var(--drupal-displace-offset-left, 0px)));
  39. }
  40. }
  41. @media (min-width: 31.25rem) {
  42. border-top-width: calc(var(--sp5) + var(--drupal-displace-offset-top, 0px));
  43. }
  44. @media (min-width: 43.75rem) {
  45. padding-block-end: var(--sp3);
  46. padding-inline-start: var(--sp3);
  47. border-top-width: calc(var(--sp7) + var(--drupal-displace-offset-top, 0px));
  48. }
  49. @media (min-width: 62.5rem) {
  50. grid-column: 5 / 14;
  51. }
  52. /*
  53. * Ensure top border has the same color as the background when in forced colors.
  54. */
  55. @media (forced-colors: active) {
  56. border-top-color: canvas;
  57. }
  58. }
  59. /*
  60. * Only apply transition styles when JS is loaded. This
  61. * works around https://bugs.chromium.org/p/chromium/issues/detail?id=332189
  62. */
  63. html.js .header-nav {
  64. transition:
  65. visibility 0.2s,
  66. transform 0.2s;
  67. }
  68. body:not(.is-always-mobile-nav) .header-nav {
  69. @media (min-width: 75rem) {
  70. position: static;
  71. display: flex;
  72. visibility: visible;
  73. overflow: visible;
  74. grid-column: 5 / 15;
  75. align-items: center;
  76. justify-content: flex-end;
  77. max-width: none;
  78. height: var(--header-height-wide-when-fixed);
  79. margin-block-start: auto;
  80. padding-block: 0;
  81. padding-inline-start: 0;
  82. padding-inline-end: 0;
  83. transition: transform 0.2s;
  84. transform: none;
  85. border-block-start: 0;
  86. box-shadow: none;
  87. }
  88. }
  89. body.is-always-mobile-nav {
  90. & .header-nav {
  91. @media (min-width: 75rem) {
  92. overflow: auto;
  93. max-width: calc((7 * (var(--grid-col-width) + var(--grid-gap))));
  94. padding-inline-end: var(--sp);
  95. transition:
  96. transform 0.2s,
  97. visibility 0.2s;
  98. border-top-width: calc(var(--drupal-displace-offset-top, 0px) + var(--sp11));
  99. }
  100. @media (min-width: 90rem) {
  101. max-width: calc(100vw - (var(--max-width) + var(--content-left)) + ((7 * (var(--grid-col-width) + var(--grid-gap)))));
  102. padding-inline-end: calc(100vw - (var(--max-width) + var(--content-left) - var(--sp)));
  103. }
  104. }
  105. }
  106. .header-nav-overlay {
  107. position: fixed;
  108. z-index: 101;
  109. inset-block-start: 0;
  110. inset-inline-start: 0;
  111. display: none;
  112. width: 100%;
  113. height: 100vh;
  114. opacity: 0.2;
  115. background: var(--color--gray-5);
  116. .is-overlay-active
  117. @media (forced-colors: active) {
  118. background: canvastext;
  119. }
  120. }

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