From 4c353ab77ba9860d316a7e363bb404ce08227fe2 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 27 Jan 2026 13:53:59 +0100 Subject: [PATCH] FEATURE handling native alignements --- plugins/carhop-blocks/src/content-box/edit.js | 8 +++++--- plugins/carhop-blocks/src/content-box/save.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/carhop-blocks/src/content-box/edit.js b/plugins/carhop-blocks/src/content-box/edit.js index b2e6ea9..a96513f 100644 --- a/plugins/carhop-blocks/src/content-box/edit.js +++ b/plugins/carhop-blocks/src/content-box/edit.js @@ -49,7 +49,7 @@ export default function Edit({ attributes, setAttributes, ...props }) { const filteredTextColors = filterTextColors( colors, postType, - backgroundColor + backgroundColor, ); function onBackgroundColorChange(value) { @@ -111,8 +111,9 @@ export default function Edit({ attributes, setAttributes, ...props }) { __nextHasNoMarginBottom __next40pxDefaultSize > - + + {blockVariant === "backgrounded" && ( @@ -157,7 +158,7 @@ export default function Edit({ attributes, setAttributes, ...props }) { ? "content-box--bg-light" : "content-box--bg-dark" } - ${blockWidth === "contained" ? "alignwide" : "alignfull"}`, + ${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`, style: { "--content-box-text-color": textColor ?? "inherit", "--content-box-background-color": @@ -192,6 +193,7 @@ export default function Edit({ attributes, setAttributes, ...props }) { "carhop-blocks/cta", "carhop-blocks/cta-group", "carhop-blocks/audio-player", + "carhop-blocks/content-box", "carhop-blocks/localisation-map", "carhop-blocks/notice-panel", "carhop-blocks/story-timeline", diff --git a/plugins/carhop-blocks/src/content-box/save.js b/plugins/carhop-blocks/src/content-box/save.js index 1b01e75..b900c77 100644 --- a/plugins/carhop-blocks/src/content-box/save.js +++ b/plugins/carhop-blocks/src/content-box/save.js @@ -16,7 +16,7 @@ export default function save({ attributes }) { className: `content-box content-box--variant-${blockVariant} ${ hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark" } - ${blockWidth === "contained" ? "alignwide" : "alignfull"}`, + ${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`, style: { "--content-box-text-color": textColor ?? "inherit", "--content-box-background-color":