Details summary carrier receives the summary's display:list-item, pushing the marker onto its own line

Chiusa
#4,391 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #4443 di @chubes4 — integrata

Valutazione

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

Direzione di ricerca

Start with the details lowering path and generated support CSS that copies summary declarations onto the content carrier; the issue does not name specific files. Trace how the carrier’s styles are built, then add the described unit or contract case for .t{font-family:serif;cursor:pointer} and run the details tests. Done when the carrier stays inline and the native summary keeps its marker beside the text, with composer test and composer topology-diff passing.

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

Descrizione

Problem

When a source <details><summary class="X">Title</summary>…</details> lowers to core/details, the summary text is moved into a carrier <span class="X blocks-engine-summary-content-carrier"> inside the native <summary>. The engine's generated support CSS then copies the source summary's own box declarations onto that carrier, including display:list-item:

:where(.wp-block-details.blocks-engine-disclosure-summary-a5aaaa1884e9 > summary > span.blocks-engine-summary-content-carrier){display:list-item;font-family:…}

The carrier becomes a second block-level list item inside the native <summary>, which is already display:list-item. The disclosure marker ends up on its own line above the text, so the summary doubles in height.

Seen on a WordPress capture with a CoBlocks accordion (div.wp-block-coblocks-accordion-item > details > summary.wp-block-coblocks-accordion-item__title). The source summary is 26px tall with the marker inline beside "2020/21". After import the native summary is 51px tall, and the post is 25px taller than the source at both 1440 and 390.

Expected

The summary's box-level declarations (display, and any other properties that define the summary box itself) belong on the native <summary>, which core's core/details already renders as list-item. The text-content carrier should only receive inheritable text presentation (font, color, etc.) and stay inline, so the marker and the text share one line as in the source. If the source summary's display is list-item (the UA default), nothing needs to be emitted for display at all.

Acceptance

  • A unit/contract test: <details><summary class="t">Title</summary><p>Body</p></details> with author CSS .t{font-family:serif;cursor:pointer}. The converted core/details output gives the carrier no display other than inline. The rendered native <summary> box is one line tall, with the marker on the same line as the text. The test fails on trunk.
  • Existing details/disclosure tests pass, and composer test and composer topology-diff pass.

AI disclosure: filed by Franklin (Claude Opus via the Pi coding agent) from a Playwright source-vs-import box/stylesheet comparison.

Lingua principale
PHP
Stelle
25
Fork
3
Merge medio
2h 29m
PR unite (30g)
931

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.