Plan the work
Keep the lead and aside aligned.
First shift
Flexible card row.
diff --git a/php-transformer/src/HtmlToBlocks/HtmlTransformer.php b/php-transformer/src/HtmlToBlocks/HtmlTransformer.php index 8803f85..afaf408 100644 --- a/php-transformer/src/HtmlToBlocks/HtmlTransformer.php +++ b/php-transformer/src/HtmlToBlocks/HtmlTransformer.php @@ -1062,7 +1062,7 @@ private function isHighValueStyledElement(DOMElement $element): bool $this->attr($element, 'role'), )))); - if ( preg_match('/(?:^|[^a-z0-9])(?:btn|button|cta|action|nav|menu|card|tile|panel|pricing|price|product)(?:[^a-z0-9]|$)/', $tokens) ) { + if ( preg_match('/(?:^|[^a-z0-9])(?:btn|button|cta|action|nav|menu|card|tile|panel|pricing|price|product|grid|columns|layout|stack|cluster|row|wrap)(?:[^a-z0-9]|$)/', $tokens) ) { return true; } @@ -1133,10 +1133,17 @@ private function safeVisualDeclarations(array $declarations): array 'border-width', 'box-shadow', 'color', + 'align-items', + 'column-gap', 'display', + 'flex-direction', + 'flex-wrap', 'font-size', 'font-weight', 'gap', + 'grid-template-columns', + 'grid-template-rows', + 'justify-content', 'line-height', 'margin', 'margin-bottom', @@ -1148,6 +1155,7 @@ private function safeVisualDeclarations(array $declarations): array 'padding-left', 'padding-right', 'padding-top', + 'row-gap', 'text-align', 'text-decoration', 'text-transform', diff --git a/php-transformer/tests/fixtures/parity/artifact-linked-css-layout-wrapper-style-signals.json b/php-transformer/tests/fixtures/parity/artifact-linked-css-layout-wrapper-style-signals.json new file mode 100644 index 0000000..15f2fab --- /dev/null +++ b/php-transformer/tests/fixtures/parity/artifact-linked-css-layout-wrapper-style-signals.json @@ -0,0 +1,39 @@ +{ + "schema": "blocks-engine/php-transformer/parity-fixture/v1", + "name": "artifact-linked-css-layout-wrapper-style-signals", + "description": "Applies safe visual declarations from linked class CSS to generic grid and flex layout wrappers.", + "source_reference": { + "repo": "php-transformer", + "path": "tests/fixtures/parity/artifact-linked-css-layout-wrapper-style-signals.json", + "notes": "Covers layout wrapper class CSS used by generated static HTML fixtures, such as grid columns and flexible card rows." + }, + "legacy_comparison": { + "skip": true, + "reason": "This upstream CSS layout signal fixture has no downstream legacy comparison." + }, + "operation": "artifact_compiler.compile", + "input": { + "artifact": { + "files": [ + { + "path": "index.html", + "kind": "html", + "content": "
Keep the lead and aside aligned.
Flexible card row.