You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
+
## [2.2.2] - 2026-05-12
8
+
9
+
### Added
10
+
11
+
-**`border-style-solid-in-html` rule** (`BaseRules`) — detects `border-style:solid` in `<div>` inline styles. WordPress's save function does not emit this property when border color uses `var:preset|color|`, so its presence in the pattern HTML guarantees a block validation mismatch.
12
+
-**`border-property-order-in-html` rule** (`BaseRules`) — detects `border-width` appearing before `border-color` in a `<div>` inline style. WordPress always serializes `border-color` first; wrong order causes a block validation mismatch on template reset.
// WordPress's block save function does not emit border-style:solid when border color is set
284
+
// via a var:preset reference. Its presence in a <div> inline style means the HTML was written
285
+
// against an older serialization and will cause a block validation mismatch.
286
+
foreach (explode("\n", $content) as$line) {
287
+
$trimmed = ltrim($line);
288
+
if (str_starts_with($trimmed, '<div') && str_contains($line, 'border-style:solid')) {
289
+
return [$this->violation('border-style-solid-in-html', 'Found "border-style:solid" in a <div> inline style — WordPress\'s save function does not generate this when border color uses var:preset|color|. Its presence causes a block validation mismatch. Remove border-style:solid from the HTML.')];
// WordPress serializes border-color before border-width in inline styles.
298
+
// border-width appearing before border-color in a <div> style attribute means the HTML
299
+
// was written against the old serialization order and will cause a block validation mismatch.
300
+
foreach (explode("\n", $content) as$line) {
301
+
if (!str_starts_with(ltrim($line), '<div')) {
302
+
continue;
303
+
}
304
+
if (preg_match('/style="[^"]*border-width:[^"]*border-color:[^"]*"/', $line)) {
305
+
return [$this->violation('border-property-order-in-html', 'Found "border-width" before "border-color" in a <div> inline style — WordPress serializes border-color first. Wrong order causes a block validation mismatch. Reorder to: border-color:...;border-width:...;border-radius:...')];
0 commit comments