Shared header splits when page-only CSS sets a no-op margin:0 on the header for most routes
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- css, html, php
- Ambito
- build-system
Direzione di ricerca
Start from the code that folds page-level CSS declarations into template_parts shell identity — the path the closed #3432 fix touched — and build a 4-route fixture matching the reproduction above. The fix needs to compare the page-only declaration's computed value against what the element already gets by default (<header> has margin 0) before letting it split the part. Done looks like a test where all four routes share one header, while a genuinely non-equivalent page rule still yields its own variant.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
One route in a shared header group can be split into its own header variant because of page CSS that changes nothing visually. If 3 of 4 routes' page CSS sets margin:0 on the header, the one route without that rule gets header-<hash> and its own page-<slug> template. A <header> already has a zero margin by default, so both versions render identically.
Related to #3432 (closed), which kept one extra page stylesheet from splitting the part. This is the reverse: the majority of routes carry a page-only rule and the minority lacks it.
Reproduction (4 routes: /, /services/, /services/a/, /services/b/)
Shared assets/site.css: .menu{display:flex;list-style:none}
Header on every route (only aria-current moves):
<header id="site-header"><nav><ul class="menu"><li><a href="/about/">About</a></li><li><a href="/services/">Services</a><ul><li><a href="/services/a/" aria-current="page">Service A</a></li><li><a href="/services/b/">Service B</a></li></ul></li></ul></nav></header>
Every route except /services/ also has this in its own <head>:
<style>#site-header{margin:0}</style>
Observed
template_parts:header,header-b889b7e71e3f,footer;page-servicesusesheader-b889b7e71e3f.margin-top:0px;margin-bottom:0px(the longhands Wix emits) splits the same way.- Without the page rule, or with it on all 4 routes, one
headeris shared. - On real routes, the split also changes lowering on the excluded page: its menu stays as plain
core/groupitems carrying runtimedata-selectedand selected-state styles, while the shared part getscore/navigation.
Expected
One shared header on all 4 routes. A page-only declaration on the shared source element whose computed value equals the value without it (here margin:0 on <header>, whose UA margin is 0, inside a group whose block margins Blocks Engine already zeroes) should not affect shell identity. A non-equivalent page rule should still split the part, or be scoped to its page as in #3432.
Real-site context
Wix code-splits per-page CSS. On a 4-route Wix import, the header's :is(#comp-…) rule includes margin-top/bottom/left/right:0px on 3 routes and leaves it out on the entry route. Removing those longhands, or adding them to the entry route, makes all 4 routes share the header (the selected-state fixes #7368 and #7386 cover the remaining route-current differences).
AI disclosure: reduced and filed by Claude (Claude Code via Franklin/Roadie) from a real-site import investigation.
- Lingua principale
- PHP
- Stelle
- 29
- Fork
- 6
- Merge medio
- 3h 40m
- PR unite (30g)
- 813
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Automattic/blocks-engine
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/blocks-engine#4943 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/blocks-engine#4942 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Automattic/blocks-engine#4921 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Automattic/blocks-engine#775 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
Automattic/blocks-engine#7505 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Automattic/blocks-engine
Issue simili
-
OpenRouter errors returned in a 200 body are thrown as a plain AiExceptionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 2 giorni
-
sync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
魚島清理:地圖焦點樣式、行走計時器、魚照片替代文字Apertasize:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
blackie0424/tao_among#184 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
bug type reconciliation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vimeo/psalm#14927 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno