nav-primary-wide.css

Same filename in other branches
  1. 9 core/themes/olivero/css/components/navigation/nav-primary-wide.css
  2. 10 core/themes/olivero/css/components/navigation/nav-primary-wide.css

Nav Primary (wide widths).

File

core/themes/olivero/css/components/navigation/nav-primary-wide.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. * Nav Primary (wide widths).
  10. */
  11. @media (min-width: 75rem) {
  12. body:not(.is-always-mobile-nav) .primary-nav__menu-item {
  13. flex-wrap: nowrap; /* Ensure that sub navigation toggle button doesn't wrap underneath link. */
  14. }
  15. body:not(.is-always-mobile-nav) .primary-nav__menu-item.primary-nav__menu-item--has-children .primary-nav__menu-link--link,
  16. body:not(.is-always-mobile-nav) .primary-nav__menu-item.primary-nav__menu-item--has-children .primary-nav__menu-link--nolink {
  17. flex-basis: auto;
  18. }
  19. /* Remove hover state if submenu exists. */
  20. body:not(.is-always-mobile-nav) .primary-nav__menu-item.primary-nav__menu-item--has-children .primary-nav__menu-link--level-1 .primary-nav__menu-link-inner::after {
  21. content: none;
  22. }
  23. body:not(.is-always-mobile-nav) .primary-nav__menu-link {
  24. letter-spacing: 0.02em;
  25. font-size: 1rem;
  26. line-height: var(--sp1-5);
  27. }
  28. body:not(.is-always-mobile-nav) .primary-nav__menu-link:focus {
  29. position: relative;
  30. outline: 0;
  31. }
  32. body:not(.is-always-mobile-nav) .primary-nav__menu-link:focus::before {
  33. position: absolute;
  34. top: 50%;
  35. left: 50%;
  36. width: calc(100% + var(--sp));
  37. height: var(--sp3);
  38. content: "";
  39. transform: translate(-50%, -50%);
  40. border: solid 2px var(--color--primary-50);
  41. border-radius: 0.25rem;
  42. }
  43. body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children {
  44. overflow: visible; /* Necessary to view icon in IE11 */
  45. padding-inline-end: 0.5625rem;
  46. }
  47. body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:focus::before {
  48. width: calc(100% + var(--sp1-5));
  49. content: "";
  50. }
  51. body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children::before {
  52. content: none;
  53. }
  54. /* Chevron icon for desktop navigation. */
  55. body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children::after {
  56. position: absolute;
  57. inset-block-start: 50%;
  58. inset-inline-start: calc(100% - 0.1875rem);
  59. width: 0.5rem;
  60. height: 0.5rem;
  61. margin-block-start: -2px;
  62. transform: translateY(-50%) rotate(45deg);
  63. /* Intentionally not using CSS logical properties. */
  64. border-top: 0;
  65. border-right: solid 2px currentColor;
  66. border-bottom: solid 2px currentColor;
  67. }
  68. body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children[aria-expanded="true"]::after {
  69. opacity: 1;
  70. }
  71. body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
  72. padding-block: var(--sp2);
  73. padding-inline-start: 0;
  74. padding-inline-end: 0;
  75. }
  76. body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner::after {
  77. transform-origin: center;
  78. border-top-width: var(--sp0-5);
  79. }
  80. body:not(.is-always-mobile-nav) .primary-nav__menu--level-1 {
  81. display: flex;
  82. align-items: stretch;
  83. margin-inline-end: var(--sp);
  84. }
  85. body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
  86. position: relative; /* Anchor secondary menu */
  87. display: flex;
  88. align-items: center;
  89. width: max-content;
  90. max-width: 12.5rem;
  91. margin-block: 0;
  92. margin-inline-start: 0;
  93. margin-inline-end: 0;
  94. }
  95. body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1:not(:last-child) {
  96. margin-inline-end: var(--sp2);
  97. }
  98. body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
  99. position: absolute;
  100. z-index: 105; /* Appear above search container. */
  101. top: calc(100% - var(--sp0-5));
  102. left: 50%;
  103. visibility: hidden;
  104. overflow: auto;
  105. width: 15.625rem;
  106. /* Ensure that long level-2 menus will never overflow viewport (focused
  107. * elements should always be in viewport per accessibility guidelines). */
  108. max-height: calc(100vh - var(--site-header-height-wide) - var(--drupal-displace-offset-top, 0px) - var(--drupal-displace-offset-bottom, 0px) - var(--sp));
  109. margin-block-start: 0;
  110. margin-inline-start: 0;
  111. padding-block: var(--sp3);
  112. padding-inline-start: var(--sp2);
  113. padding-inline-end: var(--sp2);
  114. transition: none;
  115. transform: translate(-50%, -1.25rem);
  116. opacity: 0;
  117. /* Intentionally not using CSS logical properties. */
  118. border-top: solid var(--color--primary-50) var(--sp0-5);
  119. border-right: solid 1px transparent; /* Transparent borders useful for Windows High Contrast mode. */
  120. border-bottom: solid 1px transparent;
  121. border-left: solid 1px transparent;
  122. border-radius: 0 0 2px 2px;
  123. background: var(--color--white);
  124. box-shadow: 0 1px 36px rgba(0, 0, 0, 0.08);
  125. }
  126. body:not(.is-always-mobile-nav) .primary-nav__menu--level-2.is-active-menu-parent {
  127. visibility: visible;
  128. margin-block-start: 0;
  129. transform: translate(-50%, 0);
  130. opacity: 1;
  131. }
  132. body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 {
  133. display: block;
  134. }
  135. body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2:focus::before {
  136. top: 0;
  137. left: calc(var(--sp0-5) * -1);
  138. height: 100%;
  139. transform: none;
  140. }
  141. body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
  142. padding-block: var(--sp0-5);
  143. padding-inline-start: 0;
  144. padding-inline-end: 0;
  145. }
  146. body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner::after {
  147. transform-origin: left; /* LTR */
  148. border-top-width: 3px;
  149. }
  150. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner::after {
  151. transform-origin: right;
  152. }
  153. /**
  154. * Arrow is placed outside of submenu because the submenu has the
  155. * `overflow: hidden` CSS rule applied.
  156. */
  157. body:not(.is-always-mobile-nav) .primary-nav__menu-🥕 {
  158. position: absolute;
  159. z-index: 105; /* Match level 2 menus. */
  160. top: calc(100% - var(--sp));
  161. left: 50%;
  162. visibility: hidden;
  163. width: 0;
  164. height: 0;
  165. transform: translate(-50%, -1.25rem);
  166. opacity: 0;
  167. /* Intentionally not using CSS logical properties. */
  168. border-right: solid 10px transparent;
  169. border-bottom: solid 10px var(--color--primary-50);
  170. border-left: solid 10px transparent;
  171. }
  172. body:not(.is-always-mobile-nav) .primary-nav__menu-🥕.is-active-menu-parent {
  173. visibility: visible;
  174. transform: translate(-50%, 0);
  175. opacity: 1;
  176. }
  177. /**
  178. * When ensuring that long menus don't overflow viewport, we can give a
  179. * little extra room when the toolbar is fixed (and is shorter).
  180. */
  181. body:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2 {
  182. max-height: calc(100vh - var(--site-header-height-wide) - var(--drupal-displace-offset-top, 0px) - var(--drupal-displace-offset-bottom, 0px) - var(--sp) + var(--sp4));
  183. }
  184. }
  185. /*
  186. * Only apply transition styles to menu when JS is loaded. This
  187. * works around https://bugs.chromium.org/p/chromium/issues/detail?id=332189
  188. */
  189. @media (min-width: 75rem) {
  190. html.js body:not(.is-always-mobile-nav) .primary-nav__menu--level-2,
  191. html.js body:not(.is-always-mobile-nav) .primary-nav__menu-🥕 {
  192. transition:
  193. visibility 0.2s,
  194. transform 0.2s,
  195. opacity 0.2s;
  196. }
  197. }

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