Dominant button look rejected when padding uses logical longhands, font-family is inherited, or colour has a :hover state
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 57/100
Direzione di ricerca
Trace the button look collector and dominantButtonLook path described in the issue, then find its contract fixtures and tests. Start by reproducing the minimal case and check how resolved styles handle logical padding, inherited font family, and state variants. Done means the fixture asserts the expected button presets and state style, button blocks no longer duplicate those values, and front-end parity is preserved.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
The dominant button look (#3716) never forms when the source sets button padding with logical longhands, inherits the button font, or has a hover colour. The collector only records a look when one element's resolved declarations include padding, border-radius, font-size and font-family. Then dominantButtonLook drops any look that is missing a field or has a state or conditional variant. Builder framework buttons hit all three:
padding-block/padding-inlinelonghands, often through custom properties, instead of thepaddingshorthand.font-familyinherited from the body, not declared on the button.- A
:hovercolour, which markscoloras a state family, so the rest colour is discarded.
kroonsbeautysalon.nl (Jimdo, trunk): all 23 a.jw-btn elements on 4 routes are rejected with missing=padding,font-family state:color. The theme gets no styles.elements.button, although the converter itself resolves every content button to the same look: 14 core/button, each carrying inline #cacaca background, #5b5b5b text, radius and 7.5px 15px padding. A button inserted in the editor gets core defaults, and Global Styles → Button restyles nothing.
Minimal case
3 pages, each with 3 buttons:
<style>
body{font-family:Georgia,serif}
.btn{--edge:15px;display:inline-flex;padding-block:7.5px;padding-inline:var(--edge);font-size:16px;font-weight:700;border-radius:8px;background-color:#cacaca;color:#5b5b5b;text-decoration:none}
.btn:hover{color:#000}
</style>
<a class="btn" href="/a">One</a> <a class="btn" href="/b">Two</a> <a class="btn" href="/c">Three</a>
Expected: styles.elements.button has the background, text colour, radius, padding, size, weight and the inherited family as presets. :hover carries the hover colour. The core/button blocks no longer repeat those values inline. Front-end parity is unchanged.
Expected
- Resolve padding from the shorthand or from physical and logical longhands, after variable resolution.
- Use the computed inherited
font-familywhen the button doesn't declare one. - A state-only variant (
:hover,:focus) keeps the rest value as the look and is emitted as the element's state style. Media or conditional variants still disqualify, as they do today.
Acceptance
- A contract fixture from the minimal case, with element styles asserted and button blocks no longer duplicating them.
- Real check: a kroonsbeautysalon.nl import has
styles.elements.buttonwith#cacaca/#5b5b5b, the 14 content buttons lose their duplicated inline colour, radius and padding, and parity is unchanged.
Investigated by Franklin (Pi via Roadie, anthropic/claude-opus).
- Lingua principale
- PHP
- Stelle
- 25
- Fork
- 3
- Merge medio
- 2h 29m
- PR unite (30g)
- 931
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 78/100
Automattic/blocks-engine#4874 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
Automattic/blocks-engine#4836 ·
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
-
Shared-chrome CSS factoring merges device-document stylesheets, so phones render the desktop widthAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Automattic/blocks-engine#4894 ·
I maintainer di solito rispondono entro 1 giorno
-
non core block: layout-shell@a[data-testid][href][target]Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 46/100
Automattic/blocks-engine#4888 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Automattic/blocks-engine
Issue simili
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
GSA/digital-gov-drupal#569 ·
I maintainer di solito rispondono entro 2 giorni
-
feature-request-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Codeinwp/wp-menu-icons#360 ·
-
[Type] Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 5 giorni