Initial commit
This commit is contained in:
474
src/extensions/megaMenu/MegaMenu.module.scss
Normal file
474
src/extensions/megaMenu/MegaMenu.module.scss
Normal file
@@ -0,0 +1,474 @@
|
||||
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';
|
||||
|
||||
/*
|
||||
Global override example:
|
||||
:root {
|
||||
--themePrimary: #00407f;
|
||||
--themeLighterAlt: #f0f5fa;
|
||||
--themeLighter: #c5d8eb;
|
||||
--themeLight: #98b8d9;
|
||||
--themeTertiary: #477db3;
|
||||
--themeSecondary: #11508f;
|
||||
--themeDarkAlt: #003973;
|
||||
--themeDark: #003061;
|
||||
--themeDarker: #002447;
|
||||
--neutralLighterAlt: #faf9f8;
|
||||
--neutralLighter: #f3f2f1;
|
||||
--neutralLight: #edebe9;
|
||||
--neutralQuaternaryAlt: #e1dfdd;
|
||||
--neutralQuaternary: #d0d0d0;
|
||||
--neutralTertiaryAlt: #c8c6c4;
|
||||
--neutralTertiary: #a19f9d;
|
||||
--neutralSecondary: #605e5c;
|
||||
--neutralSecondaryAlt: #8a8886;
|
||||
--neutralPrimaryAlt: #3b3a39;
|
||||
--neutralPrimary: #323130;
|
||||
--neutralDark: #201f1e;
|
||||
--black: #000000;
|
||||
--white: #ffffff;
|
||||
|
||||
--megaMenuNavBackground: #5f6f74;
|
||||
--megaMenuNavHoverBackground: #6f8085;
|
||||
--megaMenuNavOpenBackground: #728388;
|
||||
--megaMenuNavTextColor: #ffffff;
|
||||
--megaMenuNavDividerColor: rgba(255, 255, 255, 0.22);
|
||||
--megaMenuPanelWidth: 1280px;
|
||||
--megaMenuZIndex: 6000;
|
||||
}
|
||||
*/
|
||||
|
||||
$mm-white: var(--white, #{$ms-color-white});
|
||||
$mm-panel-surface: var(--white, #{$ms-color-white});
|
||||
$mm-panel-border: var(--neutralLight, #{$ms-color-neutralLight});
|
||||
$mm-panel-divider: var(--neutralQuaternaryAlt, #{$ms-color-neutralQuaternaryAlt});
|
||||
$mm-text: var(--neutralPrimary, #{$ms-color-neutralPrimary});
|
||||
$mm-text-muted: var(--neutralSecondary, #{$ms-color-neutralSecondary});
|
||||
$mm-nav-background: var(--megaMenuNavBackground, #5f6f74);
|
||||
$mm-nav-hover-background: var(--megaMenuNavHoverBackground, #6f8085);
|
||||
$mm-nav-open-background: var(--megaMenuNavOpenBackground, #728388);
|
||||
$mm-nav-divider: var(--megaMenuNavDividerColor, rgba(255, 255, 255, 0.22));
|
||||
$mm-nav-text: var(--megaMenuNavTextColor, #ffffff);
|
||||
$mm-focus-accent: var(--themePrimary, #{$ms-color-themePrimary});
|
||||
$mm-focus-soft: var(--themeLighterAlt, #{$ms-color-themeLighterAlt});
|
||||
$mm-panel-shadow: var(--megaMenuPanelShadow, 0 14px 28px rgba(0, 0, 0, 0.18));
|
||||
$mm-panel-width: var(--megaMenuPanelWidth, 1280px);
|
||||
$mm-nav-height: var(--megaMenuTopNavHeight, 34px);
|
||||
$mm-nav-inline-padding: var(--megaMenuNavInlinePadding, 8px);
|
||||
$mm-item-inline-padding: var(--megaMenuItemInlinePadding, 12px);
|
||||
$mm-column-padding-x: var(--megaMenuColumnPaddingX, 18px);
|
||||
$mm-column-padding-y: var(--megaMenuColumnPaddingY, 16px);
|
||||
$mm-link-radius: var(--megaMenuLinkRadius, 2px);
|
||||
$mm-layer-index: var(--megaMenuZIndex, 6000);
|
||||
|
||||
:global {
|
||||
:root {
|
||||
--megaMenuNavBackground: #5f6f74;
|
||||
--megaMenuNavHoverBackground: #6f8085;
|
||||
--megaMenuNavOpenBackground: #728388;
|
||||
--megaMenuNavTextColor: #ffffff;
|
||||
--megaMenuNavDividerColor: rgba(255, 255, 255, 0.22);
|
||||
--megaMenuTopNavHeight: 34px;
|
||||
--megaMenuPanelWidth: 1280px;
|
||||
--megaMenuPanelShadow: 0 14px 28px rgba(0, 0, 0, 0.18);
|
||||
--megaMenuZIndex: 6000;
|
||||
--megaMenuNavInlinePadding: 8px;
|
||||
--megaMenuItemInlinePadding: 12px;
|
||||
--megaMenuColumnPaddingX: 18px;
|
||||
--megaMenuColumnPaddingY: 16px;
|
||||
--megaMenuLinkRadius: 2px;
|
||||
--megaMenuColumnCount: 4;
|
||||
}
|
||||
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
top: -40px;
|
||||
left: 6px;
|
||||
background: $mm-focus-accent;
|
||||
color: $mm-white;
|
||||
padding: 8px 12px;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
border-radius: 4px;
|
||||
z-index: 10000;
|
||||
transition: top 0.2s ease;
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
top: 6px;
|
||||
}
|
||||
|
||||
#CustomNavigation {
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
z-index: $mm-layer-index;
|
||||
}
|
||||
|
||||
.mega-menu-main {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
background-color: #5f6f74;
|
||||
background-color: $mm-nav-background;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.18);
|
||||
box-shadow: none;
|
||||
overflow: visible;
|
||||
z-index: $mm-layer-index;
|
||||
}
|
||||
|
||||
.mega-menu-main > ul,
|
||||
.mega-menu-top-level {
|
||||
margin: 0 auto;
|
||||
max-width: $mm-panel-width;
|
||||
background-color: inherit;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
list-style: none;
|
||||
padding: 0 $mm-nav-inline-padding;
|
||||
padding-inline-start: $mm-nav-inline-padding;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.mega-menu-main > ul > li,
|
||||
.mega-menu-top-item {
|
||||
position: static;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
flex: 0 0 auto;
|
||||
border-right: 1px solid $mm-nav-divider;
|
||||
}
|
||||
|
||||
.mega-menu-main > ul > li:last-child,
|
||||
.mega-menu-top-item:last-child {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.mega-menu-main > ul > li > a,
|
||||
.mega-menu-main > ul > li > span[role="menuitem"],
|
||||
.menu-item-link,
|
||||
.menu-item-text {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: $mm-nav-height;
|
||||
padding: 0 $mm-item-inline-padding;
|
||||
color: $mm-nav-text;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
transition: background-color 0.14s ease, color 0.14s ease;
|
||||
outline: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.menu-item-text {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.menu-item-has-children::after {
|
||||
content: '';
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
margin-left: 8px;
|
||||
border-right: 1px solid currentColor;
|
||||
border-bottom: 1px solid currentColor;
|
||||
transform: translateY(-1px) rotate(45deg);
|
||||
transition: transform 0.14s ease;
|
||||
}
|
||||
|
||||
.menu-item-has-children[aria-expanded="true"]::after {
|
||||
transform: translateY(1px) rotate(-135deg);
|
||||
}
|
||||
|
||||
.mega-menu-top-item.is-active > a,
|
||||
.mega-menu-top-item.is-active > span,
|
||||
.menu-item-link.is-active,
|
||||
.menu-item-text.is-active {
|
||||
background: $mm-nav-open-background;
|
||||
}
|
||||
|
||||
.mega-menu-top-item.is-current > a,
|
||||
.mega-menu-top-item.is-current > span,
|
||||
.menu-item-link.is-current,
|
||||
.menu-item-text.is-current {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.mega-menu-main > ul > li:hover > a,
|
||||
.mega-menu-main > ul > li:hover > span[role="menuitem"],
|
||||
.mega-menu-main > ul > li > a[aria-expanded="true"],
|
||||
.mega-menu-main > ul > li > span[aria-expanded="true"],
|
||||
.menu-item-link:hover,
|
||||
.menu-item-text:hover {
|
||||
color: $mm-nav-text;
|
||||
background: $mm-nav-hover-background;
|
||||
}
|
||||
|
||||
.mega-menu-main > ul > li > a[aria-expanded="true"],
|
||||
.mega-menu-main > ul > li > span[aria-expanded="true"] {
|
||||
background: $mm-nav-open-background;
|
||||
}
|
||||
|
||||
.mega-menu-main > ul > li > a:focus,
|
||||
.mega-menu-main > ul > li > span[role="menuitem"]:focus,
|
||||
.menu-item-link:focus,
|
||||
.menu-item-text:focus {
|
||||
color: $mm-nav-text;
|
||||
background: $mm-nav-open-background;
|
||||
box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
|
||||
}
|
||||
|
||||
.mega-menu {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 100%;
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
background-color: #ffffff;
|
||||
background-color: $mm-panel-surface;
|
||||
background-image: none;
|
||||
mix-blend-mode: normal;
|
||||
border: 1px solid $mm-panel-border;
|
||||
border-top: 0;
|
||||
box-shadow: $mm-panel-shadow;
|
||||
max-height: calc(100vh - #{$mm-nav-height});
|
||||
isolation: isolate;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
z-index: calc(#{$mm-layer-index} + 1);
|
||||
transition: opacity 0.16s ease, visibility 0.16s ease;
|
||||
}
|
||||
|
||||
.mega-menu-main > ul > li:hover .mega-menu,
|
||||
.mega-menu.js-open {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
display: block;
|
||||
background-color: #ffffff;
|
||||
background-color: $mm-panel-surface;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.mega-menu-grid {
|
||||
max-width: $mm-panel-width;
|
||||
background-color: inherit;
|
||||
margin: 0 auto;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(var(--megaMenuColumnCount, 4), minmax(0, 1fr));
|
||||
gap: 0;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.mega-menu-category {
|
||||
min-width: 0;
|
||||
padding: $mm-column-padding-y $mm-column-padding-x 14px;
|
||||
border-right: 1px solid $mm-panel-divider;
|
||||
}
|
||||
|
||||
.mega-menu-grid > .mega-menu-category:last-child {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.mega-menu-category > h3,
|
||||
.mega-menu-category-title {
|
||||
margin: 0 0 10px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.mega-menu-category > h3 > span,
|
||||
.mega-menu-category > h3 > a {
|
||||
display: block;
|
||||
color: $mm-text;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
line-height: 18px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.mega-menu-category.is-active > h3 > span,
|
||||
.mega-menu-category.is-active > h3 > a,
|
||||
.mega-menu-category > h3 > span.is-active,
|
||||
.mega-menu-category > h3 > a.is-active {
|
||||
color: $mm-text;
|
||||
}
|
||||
|
||||
.mega-menu-category.is-current > h3 > a,
|
||||
.mega-menu-category > h3 > a.is-current {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.mega-menu-category > h3 > a:hover {
|
||||
color: $mm-text;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.mega-menu-category > h3 > a:focus {
|
||||
background: $mm-focus-soft;
|
||||
color: $mm-text;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 0 2px $mm-focus-accent;
|
||||
padding: 1px 4px;
|
||||
margin: -1px -4px;
|
||||
}
|
||||
|
||||
.mega-menu-category ul,
|
||||
.mega-menu-links {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-inline-start: 0;
|
||||
}
|
||||
|
||||
.mega-menu-category ul li,
|
||||
.mega-menu-links li {
|
||||
margin: 0 0 6px;
|
||||
}
|
||||
|
||||
.mega-menu-category ul li:last-child,
|
||||
.mega-menu-links li:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.mega-menu-category ul li a,
|
||||
.mega-menu-links li a {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 1px 2px;
|
||||
border-radius: $mm-link-radius;
|
||||
color: $mm-text-muted;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 18px;
|
||||
text-decoration: none;
|
||||
transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
|
||||
}
|
||||
|
||||
.mega-menu-category ul li.is-active > a,
|
||||
.mega-menu-links li.is-active > a,
|
||||
.mega-menu-category ul li a.is-active,
|
||||
.mega-menu-links li a.is-active {
|
||||
color: $mm-text;
|
||||
}
|
||||
|
||||
.mega-menu-category ul li.is-current > a,
|
||||
.mega-menu-links li.is-current > a,
|
||||
.mega-menu-category ul li a.is-current,
|
||||
.mega-menu-links li a.is-current {
|
||||
color: $mm-text;
|
||||
font-weight: 600;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.mega-menu-category ul li a:hover,
|
||||
.mega-menu-links li a:hover {
|
||||
background: transparent;
|
||||
color: $mm-text;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.mega-menu-category ul li a:focus,
|
||||
.mega-menu-links li a:focus {
|
||||
background: $mm-focus-soft;
|
||||
color: $mm-text;
|
||||
box-shadow: 0 0 0 2px $mm-focus-accent;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.mega-menu-grid {
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
}
|
||||
|
||||
.mega-menu-category {
|
||||
padding: 14px 16px 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.mega-menu-main > ul,
|
||||
.mega-menu-top-level {
|
||||
padding: 0 6px;
|
||||
padding-inline-start: 6px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.mega-menu-main > ul > li,
|
||||
.mega-menu-top-item {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.mega-menu-main > ul > li > a,
|
||||
.mega-menu-main > ul > li > span[role="menuitem"],
|
||||
.menu-item-link,
|
||||
.menu-item-text {
|
||||
min-height: 36px;
|
||||
padding: 0 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.mega-menu {
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.mega-menu-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.mega-menu-category {
|
||||
padding: 14px 12px;
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid $mm-panel-divider;
|
||||
}
|
||||
|
||||
.mega-menu-grid > .mega-menu-category:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.skip-link,
|
||||
.menu-item-has-children::after,
|
||||
.mega-menu-main > ul > li > a,
|
||||
.mega-menu-main > ul > li > span[role="menuitem"],
|
||||
.menu-item-link,
|
||||
.menu-item-text,
|
||||
.mega-menu,
|
||||
.mega-menu-category ul li a,
|
||||
.mega-menu-links li a {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-contrast: high) {
|
||||
.mega-menu-main > ul > li > a:focus,
|
||||
.mega-menu-main > ul > li > span[role="menuitem"]:focus,
|
||||
.menu-item-link:focus,
|
||||
.menu-item-text:focus,
|
||||
.mega-menu-category > h3 > a:focus,
|
||||
.mega-menu-category ul li a:focus,
|
||||
.mega-menu-links li a:focus {
|
||||
outline: 2px solid;
|
||||
outline-offset: 2px;
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
} /* End :global */
|
||||
Reference in New Issue
Block a user