From c8eb925d054308de4730121092d99e50bf87a847 Mon Sep 17 00:00:00 2001 From: Kai Date: Wed, 9 Feb 2022 17:03:31 -0500 Subject: [PATCH 01/19] Add grid for mega menu content and styles for links --- assets/component-mega-menu.css | 50 ++++++++++++++++++++++++++-------- snippets/mega-menu.liquid | 10 +++---- 2 files changed, 43 insertions(+), 17 deletions(-) diff --git a/assets/component-mega-menu.css b/assets/component-mega-menu.css index f587d28326b..4bd5c8b8ab9 100644 --- a/assets/component-mega-menu.css +++ b/assets/component-mega-menu.css @@ -1,38 +1,64 @@ .mega-menu { - position: initial; + position: static; } -.mega-menu-content { +.mega-menu__content { background-color: rgb(var(--color-background)); border-left: 0; border-radius: 0; border-right: 0; left: 0; - padding-bottom: 3.2rem; - padding-top: 3.2rem; + padding-bottom: 2.4rem; + padding-top: 2.4rem; position: absolute; right: 0; top: 100%; } -.mega-menu .header__submenu { - min-width: auto; - top: 100%; -} - -.js .mega-menu-content { +.js .mega-menu__content { opacity: 0; transform: translateY(-1.5rem); } -.mega-menu[open] .mega-menu-content { +.mega-menu[open] .mega-menu__content { animation: animateMenuOpen var(--duration-default) ease; animation-fill-mode: forwards; } @media (prefers-reduced-motion) { - .mega-menu[open] .mega-menu-content { + .mega-menu[open] .mega-menu__content { opacity: 1; transform: translateY(0); } } + +.mega-menu__list { + display: grid; + gap: 2.4rem 4rem; + grid-template-columns: repeat(6, minmax(0, 1fr)); + list-style: none; +} + +.mega-menu__link { + color: rgba(var(--color-foreground), 0.75); + display: inline-block; + padding-bottom: 0.8rem; + padding-top: 0.8rem; + text-decoration: none; + text-underline-offset: 0.3rem; + transition: text-decoration var(--duration-short) ease; +} + +.mega-menu__link:hover, +.mega-menu__link--active { + color: rgb(var(--color-foreground)); + text-decoration: underline; +} + +.mega-menu__link--active:hover { + text-decoration-thickness: 0.2rem; +} + +.mega-menu__link--level-1 { + text-transform: uppercase; +} diff --git a/snippets/mega-menu.liquid b/snippets/mega-menu.liquid index 652afe12ff3..6e6a0e1e6c6 100644 --- a/snippets/mega-menu.liquid +++ b/snippets/mega-menu.liquid @@ -9,18 +9,18 @@ {{ link.title | escape }} {% render 'icon-caret' %} -