nav-primary-wide.css

Same filename in other branches
  1. 10 core/themes/olivero/css/components/navigation/nav-primary-wide.css
  2. 11.x 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: 1.6875rem;
  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% + 1.125rem);
  37. height: 3.375rem;
  38. content: "";
  39. transform: translate(-50%, -50%);
  40. border: solid 2px #2494db;
  41. border-radius: 0.25rem;
  42. }
  43. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children {
  44. padding-right: 0.5625rem;
  45. }
  46. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children {
  47. padding-left: 0.5625rem;
  48. }
  49. body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children {
  50. overflow: visible; /* Necessary to view icon in IE11 */
  51. }
  52. body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:focus:before {
  53. width: calc(100% + 1.6875rem);
  54. content: "";
  55. }
  56. body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:before {
  57. content: none;
  58. }
  59. /* Chevron icon for desktop navigation. */
  60. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:after {
  61. left: calc(100% - 0.1875rem);
  62. }
  63. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:after {
  64. right: calc(100% - 0.1875rem);
  65. }
  66. body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:after {
  67. position: absolute;
  68. top: 50%;
  69. width: 0.5rem;
  70. height: 0.5rem;
  71. margin-top: -2px;
  72. transform: translateY(-50%) rotate(45deg);
  73. /* Intentionally not using CSS logical properties. */
  74. border-top: 0;
  75. border-right: solid 2px currentColor;
  76. border-bottom: solid 2px currentColor;
  77. }
  78. body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children[aria-expanded="true"]:after {
  79. opacity: 1;
  80. }
  81. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
  82. padding-left: 0;
  83. }
  84. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
  85. padding-right: 0;
  86. }
  87. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
  88. padding-right: 0;
  89. }
  90. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
  91. padding-left: 0;
  92. }
  93. body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
  94. padding-top: 2.25rem;
  95. padding-bottom: 2.25rem;
  96. }
  97. body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner:after {
  98. transform-origin: center;
  99. border-top-width: 9px;
  100. }
  101. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-1 {
  102. margin-right: 1.125rem;
  103. }
  104. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-1 {
  105. margin-left: 1.125rem;
  106. }
  107. body:not(.is-always-mobile-nav) .primary-nav__menu--level-1 {
  108. display: flex;
  109. align-items: stretch;
  110. }
  111. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
  112. margin-left: 0;
  113. }
  114. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
  115. margin-right: 0;
  116. }
  117. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
  118. margin-right: 0;
  119. }
  120. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
  121. margin-left: 0;
  122. }
  123. body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
  124. position: relative; /* Anchor secondary menu */
  125. display: flex;
  126. align-items: center;
  127. width: max-content;
  128. max-width: 12.5rem;
  129. margin-top: 0;
  130. margin-bottom: 0;
  131. }
  132. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1:not(:last-child) {
  133. margin-right: 2.25rem;
  134. }
  135. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1:not(:last-child) {
  136. margin-left: 2.25rem;
  137. }
  138. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
  139. margin-left: 0;
  140. }
  141. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
  142. margin-right: 0;
  143. }
  144. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
  145. padding-left: 2.25rem;
  146. }
  147. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
  148. padding-right: 2.25rem;
  149. }
  150. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
  151. padding-right: 2.25rem;
  152. }
  153. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
  154. padding-left: 2.25rem;
  155. }
  156. body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
  157. position: absolute;
  158. z-index: 105; /* Appear above search container. */
  159. top: calc(100% - 0.5625rem);
  160. left: 50%;
  161. visibility: hidden;
  162. overflow: auto;
  163. width: 15.625rem;
  164. /**
  165. * Ensure that long level-2 menus will never overflow viewport (focused
  166. * elements should always be in viewport per accessibility guidelines).
  167. */
  168. max-height: calc(100vh - 12.375rem);
  169. margin-top: 0;
  170. padding-top: 3.375rem;
  171. padding-bottom: 3.375rem;
  172. transition: none;
  173. transform: translate(-50%, -1.25rem);
  174. opacity: 0;
  175. /* Intentionally not using CSS logical properties. */
  176. border-top: solid #2494db 9px;
  177. border-right: solid 1px transparent; /* Transparent borders useful for Windows High Contrast mode. */
  178. border-bottom: solid 1px transparent;
  179. border-left: solid 1px transparent;
  180. border-radius: 0 0 2px 2px;
  181. background: #fff;
  182. box-shadow: 0 1px 36px rgba(0, 0, 0, 0.08);
  183. }
  184. body:not(.is-always-mobile-nav) .primary-nav__menu--level-2.is-active-menu-parent {
  185. visibility: visible;
  186. margin-top: 0;
  187. transform: translate(-50%, 0);
  188. opacity: 1;
  189. }
  190. body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 {
  191. display: block;
  192. }
  193. body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2:focus:before {
  194. top: 0;
  195. left: -0.5625rem;
  196. height: 100%;
  197. transform: none;
  198. }
  199. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
  200. padding-left: 0;
  201. }
  202. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
  203. padding-right: 0;
  204. }
  205. [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
  206. padding-right: 0;
  207. }
  208. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
  209. padding-left: 0;
  210. }
  211. body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
  212. padding-top: 0.5625rem;
  213. padding-bottom: 0.5625rem;
  214. }
  215. body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner:after {
  216. transform-origin: left;
  217. border-top-width: 3px;
  218. }
  219. /**
  220. * Arrow is placed outside of submenu because the submenu has the
  221. * `overflow: hidden` CSS rule applied.
  222. */
  223. body:not(.is-always-mobile-nav) .primary-nav__menu-🥕 {
  224. position: absolute;
  225. z-index: 105; /* Match level 2 menus. */
  226. top: calc(100% - 1.125rem);
  227. left: 50%;
  228. visibility: hidden;
  229. width: 0;
  230. height: 0;
  231. transform: translate(-50%, -1.25rem);
  232. opacity: 0;
  233. /* Intentionally not using CSS logical properties. */
  234. border-right: solid 10px transparent;
  235. border-bottom: solid 10px #2494db;
  236. border-left: solid 10px transparent;
  237. }
  238. body:not(.is-always-mobile-nav) .primary-nav__menu-🥕.is-active-menu-parent {
  239. visibility: visible;
  240. transform: translate(-50%, 0);
  241. opacity: 1;
  242. }
  243. /**
  244. * When ensuring that long menus don't overflow viewport, we can give a
  245. * little extra room when the toolbar is fixed (and is shorter).
  246. */
  247. body:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2 {
  248. max-height: calc(100vh - 7.875rem);
  249. }
  250. }
  251. /*
  252. * Take into account Drupal's admin toolbars when ensuring that long level-2
  253. * menus will never overflow viewport.
  254. */
  255. @media (min-width: 75rem) {
  256. /* Toolbar is fixed, and tray is vertical or toolbar is horizontal and tray is closed. */
  257. body.toolbar-vertical:not(.is-always-mobile-nav) .primary-nav__menu--level-2,
  258. body.toolbar-horizontal.toolbar-fixed:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
  259. max-height: calc(100vh - 14.8125rem);
  260. }
  261. body.toolbar-vertical:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2,
  262. body.toolbar-horizontal.toolbar-fixed:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2 {
  263. max-height: calc(100vh - 10.3125rem);
  264. }
  265. /* Toolbar is horizontal fixed, and tray is open. */
  266. body.toolbar-horizontal.toolbar-fixed.toolbar-tray-open:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
  267. max-height: calc(100vh - 17.3125rem);
  268. }
  269. body.toolbar-horizontal.toolbar-fixed.toolbar-tray-open:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2 {
  270. max-height: calc(100vh - 12.8125rem);
  271. }
  272. }
  273. /*
  274. * Only apply transition styles to menu when JS is loaded. This
  275. * works around https://bugs.chromium.org/p/chromium/issues/detail?id=332189
  276. */
  277. @media (min-width: 75rem) {
  278. html.js body:not(.is-always-mobile-nav) .primary-nav__menu--level-2,
  279. html.js body:not(.is-always-mobile-nav) .primary-nav__menu-🥕 {
  280. transition: visibility 0.2s, transform 0.2s, opacity 0.2s;
  281. }
  282. }
  283. @media (min-width: 75rem) {
  284. [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner:after {
  285. transform-origin: right;
  286. }
  287. }

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