FEATURE handling native alignements

This commit is contained in:
Antoine M 2026-01-27 13:53:59 +01:00
parent 9eda00022e
commit 4c353ab77b
2 changed files with 6 additions and 4 deletions

View File

@ -49,7 +49,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
const filteredTextColors = filterTextColors( const filteredTextColors = filterTextColors(
colors, colors,
postType, postType,
backgroundColor backgroundColor,
); );
function onBackgroundColorChange(value) { function onBackgroundColorChange(value) {
@ -111,8 +111,9 @@ export default function Edit({ attributes, setAttributes, ...props }) {
__nextHasNoMarginBottom __nextHasNoMarginBottom
__next40pxDefaultSize __next40pxDefaultSize
> >
<ToggleGroupControlOption value="full" label="Pleine largeur" />
<ToggleGroupControlOption value="contained" label="Contenue" /> <ToggleGroupControlOption value="contained" label="Contenue" />
<ToggleGroupControlOption value="wide" label="Large" />
<ToggleGroupControlOption value="full" label="Pleine largeur" />
</ToggleGroupControl> </ToggleGroupControl>
{blockVariant === "backgrounded" && ( {blockVariant === "backgrounded" && (
@ -157,7 +158,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
? "content-box--bg-light" ? "content-box--bg-light"
: "content-box--bg-dark" : "content-box--bg-dark"
} }
${blockWidth === "contained" ? "alignwide" : "alignfull"}`, ${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`,
style: { style: {
"--content-box-text-color": textColor ?? "inherit", "--content-box-text-color": textColor ?? "inherit",
"--content-box-background-color": "--content-box-background-color":
@ -192,6 +193,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
"carhop-blocks/cta", "carhop-blocks/cta",
"carhop-blocks/cta-group", "carhop-blocks/cta-group",
"carhop-blocks/audio-player", "carhop-blocks/audio-player",
"carhop-blocks/content-box",
"carhop-blocks/localisation-map", "carhop-blocks/localisation-map",
"carhop-blocks/notice-panel", "carhop-blocks/notice-panel",
"carhop-blocks/story-timeline", "carhop-blocks/story-timeline",

View File

@ -16,7 +16,7 @@ export default function save({ attributes }) {
className: `content-box content-box--variant-${blockVariant} ${ className: `content-box content-box--variant-${blockVariant} ${
hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark" hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"
} }
${blockWidth === "contained" ? "alignwide" : "alignfull"}`, ${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`,
style: { style: {
"--content-box-text-color": textColor ?? "inherit", "--content-box-text-color": textColor ?? "inherit",
"--content-box-background-color": "--content-box-background-color":