Skip to content

Migrate navigation mega-menus to the Core Icon block (LS-3229) - #44

Open
brandonmarshal wants to merge 2 commits into
developfrom
feature/ls-3229-icon-block-navigation
Open

Migrate navigation mega-menus to the Core Icon block (LS-3229)#44
brandonmarshal wants to merge 2 commits into
developfrom
feature/ls-3229-icon-block-navigation

Conversation

@brandonmarshal

Copy link
Copy Markdown
Collaborator

Summary

Replaces every outermost/icon-block (third-party "Icon Block" plugin) instance in the navigation mega-menus with WordPress 7.1's native Core Icon block (core/icon), referencing icons from the lightspeed collection registered in ls-plugin. First of 5 stacked batches migrating all 38 outermost/icon-block usages across the theme (see LS-3229).

Files changed (8 files, 81 icon instances)

  • parts/about-mega-menu.htmllightbulb, rocket, shield, trend-up, seal-check, wheelchair + 6× arrow-right chevron
  • parts/insights-mega-menu.htmlcube, brain, arrows-clockwise, tray, palette, book + 6× arrow-right chevron
  • parts/mobile-menu.htmldot ×6 (one per lifecycle phase — Discover/Create/Build/Launch/Grow/Evolve, each its own phase colour)
  • parts/pricing-mega-menu.htmlstack, building-office, archive, trending-up, calculator, seal-check + 6× arrow-right chevron
  • parts/services-mega-menu.htmldot ×6 (per-phase) + chevron-right ×5 (all phases except Evolve, which had no trailing arrow in the original either)
  • parts/solutions-mega-menu.htmlcredit-card, newspaper, brain, chat, cart, airplane-tilt, palette + 7× arrow-right chevron
  • parts/work-mega-menu.htmlfolder ×2, puzzle-piece, cart, database, quote + 6× arrow-right chevron
  • patterns/menu/menu-item-card.phpfolder (36px placeholder icon) + arrow-right chevron

Markup change

core/icon is a dynamic (server-rendered) block, unlike the static outermost/icon-block. Every instance collapses from a two-div/inline-SVG block to a single self-closing comment, e.g.:

<!-- wp:icon {"icon":"lightspeed/dot","className":"has-text-color","style":{"color":{"text":"var(--wp--custom--color--phase--discover)"},"dimensions":{"width":"8px"}}} /-->

No flipHorizontal/rotation attributes were needed — none of the chevron instances had a non-zero transform in the original markup.

Icon mapping verification

Every icon assignment was verified by extracting each source <svg> and exact-path-matching against the real files in ls-plugin/assets/icons/lightspeed/, rather than relying on the icon-sourcing mapping document alone (which undercounted actual occurrences). Two ambiguous cases were confirmed directly:

  • lightspeed/trend-up and lightspeed/trending-up are intentionally distinct slugs for a byte-identical shape — disambiguated by file context (about-mega-menutrend-up, pricing-mega-menutrending-up).
  • lightspeed/palette and lightspeed/brain were corrected from an earlier, backwards manual identification — confirmed against the actual collection files as source of truth.

Test plan

  • outermost/icon-block count is 0 across all 8 changed files (scripted check)
  • wp:icon instance count matches the verified 81-instance mapping table exactly, per file
  • Every wp:icon JSON attribute payload parses as valid JSON (scripted check across all 8 files)
  • PHP block-rendering test (parse_blocks + render_block via wp eval-file) on all 8 files — zero errors, correct <svg>/.wp-block-icon count per file
  • Manual visual QA in the Site Editor and live frontend (Studio, light and dark) for Work, Solutions, Pricing, Insights, About, and Services mega menus — icons, colours, and the Services per-phase layout all match pre-migration appearance
  • Confirmed in the Site Editor that icons remain freely re-editable via the lightspeed collection picker

Part of LS-3229 (Batch 1 of 5). Next: Batch 2 (Homepage) on a branch stacked on top of this one.

Icon block conversion
- Replace outermost/icon-block with core/icon across 8 nav files
- Reference lightspeed/{name} icons instead of inline SVG
- Cover all 81 instances: mega-menus, mobile menu, menu-item-card pattern

Icons used
- about-mega-menu: lightbulb, rocket, shield, trend-up, seal-check, wheelchair
- insights-mega-menu: cube, brain, arrows-clockwise, tray, palette, book
- pricing-mega-menu: stack, building-office, archive, trending-up, calculator, seal-check
- solutions-mega-menu: credit-card, newspaper, brain, chat, cart, airplane-tilt, palette
- work-mega-menu: folder (x2), puzzle-piece, cart, database, quote
- mobile-menu, services-mega-menu: dot (per lifecycle phase) + chevron-right
- All mega-menus, menu-item-card: arrow-right (chevron)

Verification
- Zero remaining outermost/icon-block references across all 8 files
- PHP block-rendering test confirms correct SVG output, no errors
- Manual QA in Site Editor and live frontend, light and dark
@brandonmarshal brandonmarshal added area:navigation Menus & nav UX area:theme Theme & styles (templates, template parts, FSE) comp:block-patterns Patterns library/registration comp:template-parts Header/footer/loop/nav parts lang:html Markup lang:php PHP code priority:normal Default priority for most issues. status:needs-review Awaiting code review labels Sep 9, 2026
@linear-code

linear-code Bot commented Sep 9, 2026

Copy link
Copy Markdown

LS-3229

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are a straightforward, consistent block swap with no remaining outermost/icon-block usage in the modified files and no functional regressions evident in the updated markup.

Pull request overview

This PR migrates the navigation mega-menu icon markup away from the third-party outermost/icon-block to WordPress Core’s core/icon block, using the lightspeed/* icon collection registered in ls-plugin, reducing theme coupling to a plugin-provided block implementation.

Changes:

  • Replaced all outermost/icon-block instances in the affected mega-menu template parts with wp:icon blocks referencing lightspeed/* icons.
  • Updated the shared menu item card pattern to use wp:icon for both the placeholder icon and chevron.
  • Preserved existing sizing and colour intent via style.dimensions.width and text colour styles where previously applied.
File summaries
File Description
patterns/menu/menu-item-card.php Swaps the pattern’s placeholder icon + chevron to Core Icon block equivalents.
parts/about-mega-menu.html Replaces About mega-menu item icons/chevrons with wp:icon using lightspeed/*.
parts/insights-mega-menu.html Replaces Insights mega-menu item icons/chevrons with wp:icon using lightspeed/*.
parts/mobile-menu.html Migrates mobile Services lifecycle phase dots to wp:icon with per-phase colours.
parts/pricing-mega-menu.html Replaces Pricing mega-menu item icons/chevrons with wp:icon using lightspeed/*.
parts/services-mega-menu.html Migrates Services per-phase dots and chevrons to wp:icon with per-phase colours.
parts/solutions-mega-menu.html Replaces Solutions mega-menu item icons/chevrons with wp:icon using lightspeed/*.
parts/work-mega-menu.html Replaces Work mega-menu item icons/chevrons with wp:icon using lightspeed/*.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@brandonmarshal
brandonmarshal added this pull request to stack #46 September 9, 2026 08:32
brandonmarshal added a commit that referenced this pull request Sep 9, 2026
…ration (LS-3720) (#49)

* Fix legacy outermost/icon-block CSS selectors broken by Core Icon migration (LS-3720)

Bug fix
- Add .wp-block-icon alongside .wp-block-outermost-icon-block in
  _menu-motion.scss (mega-menu chevron hover/focus color + reduced-motion)
- Add .wp-block-icon alongside .wp-block-outermost-icon-block .icon-container
  in work-archive-sections.scss (card-link-row hover/focus icon color)
- Both fixes are additive: any not-yet-converted outermost/icon-block
  instance keeps working, core/icon instances now get the same treatment

Cleanup
- Remove dead .site-footer .icon-container svg{fill:currentColor} rule
  from _footer-motion.scss — redundant now that every lightspeed/*
  icon bakes fill="currentColor" into its own path, and WP core's
  default stylesheet already forces .wp-block-icon svg{fill:currentColor}
- Delete assets/css/animations.min.css — stale, unenqueued build
  artifact with no reference anywhere in the codebase

Context
- Found via audit LS-3719, filed as bug LS-3720
- Not stacked on the LS-3229 batch PR chain (#44/#45/#47/#48) since
  none of these files overlap with those diffs; branched off develop

Verification
- npm run build:css run in full; only animations.css and
  work-archive-sections.css changed
- Compiled CSS selector counts verified (4+4 and 2+2 respectively)
- Confirmed zero remaining references to animations.min.css before deleting

* Move mega-menu icon hover colour out of the motion partial (LS-3720)

Bug fix
- Relocate `.is-style-mega-menu-item-default` icon hover/focus `color`
  rule from `src/scss/animations/_menu-motion.scss` to
  `src/scss/structural/_mega-menu.scss`
- Animations partial now only holds the `transition` property and its
  reduced-motion override, per AGENTS.md's motion-only rule for
  `src/scss/animations/**`

Context
- Addresses Copilot review feedback on PR #49: the colour swap is a
  non-motion property and belongs in the structural partial alongside
  the existing `.is-style-mega-menu-item-default` rules
- Rebuilt `assets/css/animations.css` to reflect the change

* Updating CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:navigation Menus & nav UX area:theme Theme & styles (templates, template parts, FSE) comp:block-patterns Patterns library/registration comp:template-parts Header/footer/loop/nav parts lang:html Markup lang:php PHP code priority:normal Default priority for most issues. status:needs-review Awaiting code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants