Raw .home / .post source selectors collide with WordPress body and post classes

Aperta
#6,930 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php, wordpress
Ambito
frontend

Direzione di ricerca

Start in ArtifactCompiler/WordPressCompatCss.php around line 288 and trace how navigation replay emits source class selectors. Then find the handling in SourceClassIdentity::needsMarker and check how it applies to raw .home and .post selectors. Add or update focused tests for navigation replay and post-like classes; done means both selector types use the source-class marker without affecting unrelated WordPress classes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Found importing https://javisantana.com/ (a ~750-page static blog) with WordPress Studio CLI 2.2.0 and the Data Liberation Agent / Static Site Importer / Blocks Engine releases current on 2026-11-19, before blocks-engine#6890, #6909, #6912 and #6914 merged.

Problem (latent; no visible difference on this site)

SourceClassIdentity::needsMarker renames source classes that WordPress also puts on <body> (home, page, single, …). Two places still emit raw source selectors that collide:

  1. Navigation style replay (ArtifactCompiler/WordPressCompatCss.php, around line 288) emits raw .home selectors. For example:

    • :root :where(.home .wp-block-navigation .wp-block-navigation-item__content){color:inherit;text-decoration:none}
    • .home footer .wp-block-navigation …{color:var(--muted)}

    On the front page <body> has class home, so these rules also restyle navigation blocks in header and footer template parts, not just the source <main class="home">.

  2. .post selectors stay raw (for example .post{max-width:var(--measure);margin:auto}). post isn't a body class, but post_class() adds it to every Query Loop item, so any archive or listing template would pick these rules up.

Evidence

On the imported homepage, removing every body class that matches a source selector changed no element's computed style or geometry at 390 and 1440px. That's only because this site has no navigation outside <main>.

Expected

The navigation replay and post-like classes go through the same source-class marker as other colliding classes.

🤖 Generated with Claude Code

Lingua principale
PHP
Stelle
29
Fork
6
Merge medio
3h 40m
PR unite (30g)
813

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Automattic/blocks-engine

Tutte le issue di Automattic/blocks-engine

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.