nav-primary-wide.css
Same filename in other branches
Nav Primary (wide widths).
File
-
core/
themes/ olivero/ css/ components/ navigation/ nav-primary-wide.css
View source
- /*
- * DO NOT EDIT THIS FILE.
- * See the following change record for more information,
- * https://www.drupal.org/node/3084859
- * @preserve
- */
-
- /**
- * @file
- * Nav Primary (wide widths).
- */
-
- @media (min-width: 75rem) {
- body:not(.is-always-mobile-nav) .primary-nav__menu-item {
- flex-wrap: nowrap; /* Ensure that sub navigation toggle button doesn't wrap underneath link. */
- }
- body:not(.is-always-mobile-nav) .primary-nav__menu-item.primary-nav__menu-item--has-children .primary-nav__menu-link--link,
- body:not(.is-always-mobile-nav) .primary-nav__menu-item.primary-nav__menu-item--has-children .primary-nav__menu-link--nolink {
- flex-basis: auto;
- }
-
- /* Remove hover state if submenu exists. */
- 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 {
- content: none;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link {
- letter-spacing: 0.02em;
- font-size: 1rem;
- line-height: 1.6875rem;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link:focus {
- position: relative;
- outline: 0;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link:focus:before {
- position: absolute;
- top: 50%;
- left: 50%;
- width: calc(100% + 1.125rem);
- height: 3.375rem;
- content: "";
- transform: translate(-50%, -50%);
- border: solid 2px #2494db;
- border-radius: 0.25rem;
- }
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children {
- padding-right: 0.5625rem;
- }
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children {
- padding-left: 0.5625rem;
- }
- body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children {
- overflow: visible; /* Necessary to view icon in IE11 */
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:focus:before {
- width: calc(100% + 1.6875rem);
- content: "";
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:before {
- content: none;
- }
-
- /* Chevron icon for desktop navigation. */
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:after {
- left: calc(100% - 0.1875rem);
- }
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:after {
- right: calc(100% - 0.1875rem);
- }
- body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:after {
- position: absolute;
- top: 50%;
- width: 0.5rem;
- height: 0.5rem;
- margin-top: -2px;
- transform: translateY(-50%) rotate(45deg);
- /* Intentionally not using CSS logical properties. */
- border-top: 0;
- border-right: solid 2px currentColor;
- border-bottom: solid 2px currentColor;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children[aria-expanded="true"]:after {
- opacity: 1;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
- padding-left: 0;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
- padding-right: 0;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
- padding-right: 0;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
- padding-left: 0;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner {
- padding-top: 2.25rem;
- padding-bottom: 2.25rem;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner:after {
- transform-origin: center;
- border-top-width: 9px;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-1 {
- margin-right: 1.125rem;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-1 {
- margin-left: 1.125rem;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu--level-1 {
- display: flex;
- align-items: stretch;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
- margin-left: 0;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
- margin-right: 0;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
- margin-right: 0;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
- margin-left: 0;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1 {
- position: relative; /* Anchor secondary menu */
- display: flex;
- align-items: center;
- width: max-content;
- max-width: 12.5rem;
- margin-top: 0;
- margin-bottom: 0;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1:not(:last-child) {
- margin-right: 2.25rem;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1:not(:last-child) {
- margin-left: 2.25rem;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
- margin-left: 0;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
- margin-right: 0;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
- padding-left: 2.25rem;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
- padding-right: 2.25rem;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
- padding-right: 2.25rem;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
- padding-left: 2.25rem;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
- position: absolute;
- z-index: 105; /* Appear above search container. */
- top: calc(100% - 0.5625rem);
- left: 50%;
- visibility: hidden;
- overflow: auto;
- width: 15.625rem;
- /**
- * Ensure that long level-2 menus will never overflow viewport (focused
- * elements should always be in viewport per accessibility guidelines).
- */
- max-height: calc(100vh - 12.375rem);
- margin-top: 0;
- padding-top: 3.375rem;
- padding-bottom: 3.375rem;
- transition: none;
- transform: translate(-50%, -1.25rem);
- opacity: 0;
- /* Intentionally not using CSS logical properties. */
- border-top: solid #2494db 9px;
- border-right: solid 1px transparent; /* Transparent borders useful for Windows High Contrast mode. */
- border-bottom: solid 1px transparent;
- border-left: solid 1px transparent;
- border-radius: 0 0 2px 2px;
- background: #fff;
- box-shadow: 0 1px 36px rgba(0, 0, 0, 0.08);
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu--level-2.is-active-menu-parent {
- visibility: visible;
- margin-top: 0;
- transform: translate(-50%, 0);
- opacity: 1;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 {
- display: block;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2:focus:before {
- top: 0;
- left: -0.5625rem;
- height: 100%;
- transform: none;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
- padding-left: 0;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
- padding-right: 0;
- }
-
- [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
- padding-right: 0;
- }
-
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
- padding-left: 0;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner {
- padding-top: 0.5625rem;
- padding-bottom: 0.5625rem;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner:after {
- transform-origin: left;
- border-top-width: 3px;
- }
-
- /**
- * Arrow is placed outside of submenu because the submenu has the
- * `overflow: hidden` CSS rule applied.
- */
- body:not(.is-always-mobile-nav) .primary-nav__menu-🥕 {
- position: absolute;
- z-index: 105; /* Match level 2 menus. */
- top: calc(100% - 1.125rem);
- left: 50%;
- visibility: hidden;
- width: 0;
- height: 0;
- transform: translate(-50%, -1.25rem);
- opacity: 0;
- /* Intentionally not using CSS logical properties. */
- border-right: solid 10px transparent;
- border-bottom: solid 10px #2494db;
- border-left: solid 10px transparent;
- }
-
- body:not(.is-always-mobile-nav) .primary-nav__menu-🥕.is-active-menu-parent {
- visibility: visible;
- transform: translate(-50%, 0);
- opacity: 1;
- }
-
- /**
- * When ensuring that long menus don't overflow viewport, we can give a
- * little extra room when the toolbar is fixed (and is shorter).
- */
- body:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2 {
- max-height: calc(100vh - 7.875rem);
- }
- }
-
- /*
- * Take into account Drupal's admin toolbars when ensuring that long level-2
- * menus will never overflow viewport.
- */
-
- @media (min-width: 75rem) {
- /* Toolbar is fixed, and tray is vertical or toolbar is horizontal and tray is closed. */
- body.toolbar-vertical:not(.is-always-mobile-nav) .primary-nav__menu--level-2,
- body.toolbar-horizontal.toolbar-fixed:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
- max-height: calc(100vh - 14.8125rem);
- }
-
- body.toolbar-vertical:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2,
- body.toolbar-horizontal.toolbar-fixed:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2 {
- max-height: calc(100vh - 10.3125rem);
- }
-
- /* Toolbar is horizontal fixed, and tray is open. */
- body.toolbar-horizontal.toolbar-fixed.toolbar-tray-open:not(.is-always-mobile-nav) .primary-nav__menu--level-2 {
- max-height: calc(100vh - 17.3125rem);
- }
-
- body.toolbar-horizontal.toolbar-fixed.toolbar-tray-open:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2 {
- max-height: calc(100vh - 12.8125rem);
- }
- }
-
- /*
- * Only apply transition styles to menu when JS is loaded. This
- * works around https://bugs.chromium.org/p/chromium/issues/detail?id=332189
- */
-
- @media (min-width: 75rem) {
- html.js body:not(.is-always-mobile-nav) .primary-nav__menu--level-2,
- html.js body:not(.is-always-mobile-nav) .primary-nav__menu-🥕 {
- transition: visibility 0.2s, transform 0.2s, opacity 0.2s;
- }
- }
-
- @media (min-width: 75rem) {
- [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner:after {
- transform-origin: right;
- }
- }
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.