Skip to content

Keep author span rules off Core navigation label wrappers - #3425

Merged
chubes4 merged 2 commits into
trunkfrom
fix/issue-3422-nav-label-wrapper
Oct 25, 2026
Merged

chubes4 merged 2 commits into
trunkfrom
fix/issue-3422-nav-label-wrapper

Conversation

@chubes4

@chubes4 chubes4 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #3422.

Root cause

A source rule such as .nav > li > a span { font:10px; display:block } is written for the subtitle span inside a link. Core navigation wraps each link's whole text in its own <span class="wp-block-navigation-item__label">, so once a is projected, the author span also matched that wrapper. The entire label then rendered at 10px as a block. The projection happens on two paths, and both lacked the guard:

  • the HtmlToBlocks author-stylesheet projector (type-span rewrite);
  • the site-compile WordPressCompatCss navigation mapping (a → .wp-block-navigation-item__content), which real imports use.

Fix

Both paths now emit span:not(:where(.wp-block-navigation-item__label)). This adds no specificity, real source spans stay matched, and only the engine-owned wrapper is excluded.

Evidence

  • tests/unit/navigation-label-wrapper-author-span.php covers the HtmlTransformer cascade (including a dormant rule) and the ArtifactCompiler site compile. Both fail on trunk.
  • composer test:unit is green.
  • Paired build: studio create --from <reduced site> --static-site-importer-path <SSI dev zip with this branch>, Chromium at 1200px:
source trunk (v0.44.151) this PR
label font 18px / 700 10px / 400 18px / 700
subtitle font 10px 10px 10px
item box 94×69 92×56 94×69

The first commit (the projector path) passed its own unit test, but the real import was unchanged. Measuring in the browser located the second path; this is why the test now also covers the site compile.

AI disclosure: the fix was drafted by a Homeboy cook (Pi coding agent, roadie/cook-heavy: gpt-6.1-sol). Homeboy marked the green candidate candidate_recoverable (Extra-Chill/homeboy#16418), so it was promoted to this branch with homeboy agent-task promote. Claude (Anthropic), running in Pi, then reviewed it, re-ran verification and paired-build evidence, and pushed it.

@chubes4
chubes4 merged commit 1a81abb into trunk Oct 25, 2026
15 checks passed
@chubes4
chubes4 deleted the fix/issue-3422-nav-label-wrapper branch October 25, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Author 'a span' rules match core navigation's label wrapper, shrinking the whole menu label

1 participant