Skip to content

Keep Prettier off block markup, and draw the borders it hid - #276

Merged
amjadr360 merged 1 commit into
mainfrom
fix/prettier-block-borders
Nov 16, 2026
Merged

amjadr360 merged 1 commit into
mainfrom
fix/prettier-block-borders

Conversation

@amjadr360

Copy link
Copy Markdown
Contributor

When Prettier splits a block's style attribute across lines, WordPress stops drawing that block's border. Core only gives a border its solid style when border-*-color or border-*-width starts the attribute or follows a semicolon. Since June this has hidden three borders on every fresh site: the top divider of two footers (footer-with-center-logo-and-menu, footer-with-site-description-and-menu) and the bottom line of the sticky header (no-title-sticky-header). This puts those three style attributes back on one line, as the block editor writes them, and stops Prettier from touching templates/ and parts/, so the new lint check can't push anyone into the same bug.

  • The lint check keeps PHP, CSS and JS. Only the template HTML step is gone.
  • A site that already saved one of these parts in the site editor is unaffected; the editor rewrote it on one line when it saved.

Screenshots

1. The two footers' top dividers

footer dividers

2. The sticky header's bottom border

sticky header border

PR description generated by Claude.

Core gives a border its solid style only when border-*-color or
border-*-width starts a block's style attribute or follows a semicolon.
Prettier splits that attribute across lines, so the two footers' top
dividers and the sticky header's bottom border never drew on a fresh
site. Their style attributes go back to the one line the block editor
writes.

Prettier now skips templates/ and parts/, and the lint workflow drops
its template HTML step, so a reformat cannot hide a border again.
@amjadr360
amjadr360 marked this pull request as ready for review November 16, 2026 04:29
@amjadr360
amjadr360 merged commit 14753ed into main Nov 16, 2026
1 check passed
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.

1 participant