Skip to content

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

Merged
brandonmarshal merged 3 commits into
developfrom
feature/ls-3720-fix-icon-block-css-selectors
Sep 9, 2026
Merged

Fix legacy outermost/icon-block CSS selectors broken by Core Icon migration (LS-3720)#49
brandonmarshal merged 3 commits into
developfrom
feature/ls-3720-fix-icon-block-css-selectors

Conversation

@brandonmarshal

@brandonmarshal brandonmarshal commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes SCSS selectors that style icons by targeting the old outermost/icon-block plugin's rendered markup classes (.wp-block-outermost-icon-block, .icon-container) instead of WordPress 7.1's Core Icon block output (a single .wp-block-icon wrapper directly around the <svg>, no nested container div). As ls-theme migrates to core/icon (LS-3229), these selectors silently stopped applying, breaking hover/focus colour transitions.

Found via a repo-wide audit (LS-3719); this PR covers the audit's remaining open items (2–5). Item 1 (card-shells.scss) was already fixed separately, on PR #48's branch.

Not stacked on the LS-3229 batch PR chain (#44#45#47#48) — none of these 6 files overlap with any batch PR's diff, so this fix doesn't need to wait on all four batch reviews to merge in order. Based directly on develop.

Files changed (6)

  • src/scss/animations/_menu-motion.scss — added .wp-block-icon alongside .wp-block-outermost-icon-block for the mega-menu item hover/focus icon-colour transition and its prefers-reduced-motion override
  • src/scss/structural/work-archive-sections.scss — added .wp-block-icon alongside .wp-block-outermost-icon-block .icon-container for the card-link-row hover/focus icon colour
  • src/scss/animations/_footer-motion.scss — removed the dead .site-footer .icon-container svg{fill:currentColor} rule (redundant: every lightspeed/* icon already bakes fill="currentColor" into its own path, and WP core's default stylesheet already forces .wp-block-icon svg{fill:currentColor} globally)
  • assets/css/animations.css — rebuilt from source
  • assets/css/work-archive-sections.css — rebuilt from source
  • assets/css/animations.min.css — deleted (stale, unenqueued build artifact — confirmed zero references anywhere in the codebase, no .min.css step exists in the build scripts)

Both selector fixes are additive, not replacements — any not-yet-converted outermost/icon-block instance (see LS-3229's "Missing icons" tracking list) keeps working exactly as before.

Test plan

  • Both SCSS files compile clean with --style=expanded (no Sass deprecation warnings)
  • Full npm run build:css run (not just the two targeted files) — confirmed only animations.css and work-archive-sections.css changed, no unintended blast radius elsewhere in the theme's compiled output
  • Compiled CSS selector counts verified directly: animations.css has 4 occurrences each of .wp-block-outermost-icon-block/.wp-block-icon (base transition, hover, focus-within, reduced-motion); work-archive-sections.css has 2 each (hover, focus-within); the dead .icon-container svg rule confirmed removed
  • Confirmed zero remaining references to assets/css/animations.min.css anywhere in the codebase before deleting it
  • Checked for over-broad selector risk: .is-style-mega-menu-item-default .wp-block-icon will match every icon in a mega-menu row (e.g. menu-item-card.php's icon-well badge, not just the trailing chevron) — confirmed this is identical breadth to the existing .wp-block-outermost-icon-block selector it's paired with, not a new regression

Closes LS-3720

…ration (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
@brandonmarshal brandonmarshal added area:theme Theme & styles (templates, template parts, FSE) lang:css Stylesheets 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-3720

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.

🟡 Changes recommended

It introduces/keeps a non-motion color hover/focus rule in src/scss/animations/_menu-motion.scss, which conflicts with the repo’s “motion files must be motion-only” convention.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates theme SCSS selectors so icon hover/focus colour treatments continue to work during the ongoing migration from the legacy outermost/icon-block markup to WordPress Core core/icon (.wp-block-icon). It also removes a stale compiled CSS artefact and refreshes the compiled CSS outputs.

Changes:

  • Add .wp-block-icon to the relevant hover/focus selector sets while keeping legacy outermost/icon-block selectors for any remaining instances.
  • Remove a footer-specific SVG fill rule deemed redundant.
  • Rebuild compiled CSS outputs and delete assets/css/animations.min.css.
File summaries
File Description
src/scss/animations/_menu-motion.scss Extends mega-menu icon hover/focus selectors to include .wp-block-icon.
src/scss/structural/work-archive-sections.scss Extends card link-row icon hover/focus selectors to include .wp-block-icon.
src/scss/animations/_footer-motion.scss Removes the footer .icon-container svg { fill: currentColor; } rule.
assets/css/animations.css Rebuilt compiled CSS reflecting the SCSS changes.
assets/css/work-archive-sections.css Rebuilt compiled CSS reflecting the SCSS changes.
assets/css/animations.min.css Removes a stale minified build artefact.
Review details

Files not reviewed (2)

  • assets/css/animations.css: Generated file
  • assets/css/work-archive-sections.css: Generated file
  • Files reviewed: 4/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread src/scss/animations/_menu-motion.scss Outdated
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
@brandonmarshal
brandonmarshal merged commit b30c812 into develop Sep 9, 2026
1 of 3 checks passed
@brandonmarshal
brandonmarshal deleted the feature/ls-3720-fix-icon-block-css-selectors branch September 9, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:theme Theme & styles (templates, template parts, FSE) lang:css Stylesheets 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.

3 participants