From f64ae1d99319e7f7dba2eeb9e820e2fecb017d66 Mon Sep 17 00:00:00 2001 From: Saulo Padilha Date: Tue, 14 Oct 2025 22:19:55 -0300 Subject: [PATCH 1/3] [MOOSE-156]: Consolidate navigation block styles and improve architecture --- .../blocks/tribe/mega-menu-item/style.pcss | 92 +------- .../blocks/tribe/navigation-link/style.pcss | 14 +- .../tribe/navigation-wrapper/style.pcss | 210 +++++++++++++++++- .../tribe/standard-menu-item/style.pcss | 198 +---------------- 4 files changed, 230 insertions(+), 284 deletions(-) diff --git a/wp-content/themes/core/blocks/tribe/mega-menu-item/style.pcss b/wp-content/themes/core/blocks/tribe/mega-menu-item/style.pcss index 8157ef50..5712129a 100644 --- a/wp-content/themes/core/blocks/tribe/mega-menu-item/style.pcss +++ b/wp-content/themes/core/blocks/tribe/mega-menu-item/style.pcss @@ -1,9 +1,11 @@ /* ------------------------------------------------------------------------- * - * Block - Mega Navigation Menu - Styles - FE / Editor + * Block - Tribe Mega Menu Item + * + * Handles styling for mega menu dropdown content and wrapper. + * First-level navigation button styles are consolidated in Navigation Wrapper. * * ------------------------------------------------------------------------- */ - .wp-block-tribe-mega-menu-item { color: var(--color-text); @@ -32,92 +34,6 @@ } } -/* mega menu item button toggle */ -.tribe-mega-menu-item__toggle { - background-color: transparent; - border: 0; - padding: var(--spacer-10) var(--spacer-30) var(--spacer-20) var(--spacer-10); - position: relative; - color: var(--color-text); - transition: var(--transition); - - @media (--mq-navigation-max) { - width: 100%; - font-size: var(--font-size-40); - text-align: left; - padding-left: 0; - } - - &::before { - content: ""; - width: 0; - height: 4px; - background-color: var(--masthead-navigation-accent-color); - position: absolute; - bottom: -4px; - left: var(--spacer-10); - transition: width 0.15s ease-in-out; - z-index: 11; - - @media (--mq-navigation-max) { - display: none; - } - } - - &::after { - content: ""; - background-color: currentcolor; - display: block; - height: 16px; - width: 10px; - mask: var(--icon-chevron-right) center no-repeat; - mask-size: contain; - position: absolute; - right: 2px; - top: calc(var(--spacer-10) + 5px); - transform: rotate(90deg); - transition: var(--transition); - } - - &:hover, - &:active, - .menu-item-active & { - outline: none; - color: var(--masthead-navigation-accent-color); - - &::before { - width: calc(100% - var(--spacer-10)); - } - - @media (--mq-navigation-max) { - outline: revert; - color: var(--color-text); - } - } - - &:focus-visible { - outline: 2px solid var(--masthead-navigation-accent-color); - } - - /* Hide border on closed menu items, even when hovered or active */ - :not(.menu-item-active) & { - - @media (--mq-navigation-max) { - - &::before { - width: 0; - } - } - } - - .menu-item-active & { - - &::after { - transform: rotate(-90deg); - } - } -} - /* enhanced menu pattern wrapper */ .site-header__mega-menu-item-wrapper { width: 100%; diff --git a/wp-content/themes/core/blocks/tribe/navigation-link/style.pcss b/wp-content/themes/core/blocks/tribe/navigation-link/style.pcss index 7e8449e0..7bde130b 100644 --- a/wp-content/themes/core/blocks/tribe/navigation-link/style.pcss +++ b/wp-content/themes/core/blocks/tribe/navigation-link/style.pcss @@ -1,16 +1,24 @@ /* ------------------------------------------------------------------------- * - * Block - Tribe Navigation Link - Styles - FE / Editor + * Block - Tribe Navigation Link + * + * Handles individual link styling with base behavior: + * - Base link styles (underline, transitions, focus states) + * - Consistent styling across all navigation contexts + * + * Context-specific enhancements are handled in Navigation Wrapper. * * ------------------------------------------------------------------------- */ .wp-block-tribe-navigation-link { + text-decoration: underline 1px; text-decoration-color: transparent; transition: var(--transition); color: var(--color-text); display: block; &:hover, + &:active, &:focus { text-decoration-color: currentcolor; } @@ -18,8 +26,4 @@ &:focus-visible { outline: 2px solid var(--masthead-navigation-accent-color); } - - .site-header__utility-menu & { - font-size: 14px; - } } diff --git a/wp-content/themes/core/blocks/tribe/navigation-wrapper/style.pcss b/wp-content/themes/core/blocks/tribe/navigation-wrapper/style.pcss index 2144df6b..053c31a0 100644 --- a/wp-content/themes/core/blocks/tribe/navigation-wrapper/style.pcss +++ b/wp-content/themes/core/blocks/tribe/navigation-wrapper/style.pcss @@ -1,8 +1,16 @@ -/* ------------------------------------------------------------------------- +/* + * Block - Tribe Navigation Wrapper * - * Block - Tribe Navigation Wrapper - Styles - FE / Editor + * Central navigation styling coordinator that handles: + * - Semantic