FEATURE introducing new variation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2026-03-20 17:11:42 +01:00
parent ccc2d0008f
commit 90a7a16dfb
2 changed files with 46 additions and 32 deletions

View File

@ -102,6 +102,10 @@ export default function Edit({ attributes, setAttributes, ...props }) {
value="backgrounded" value="backgrounded"
label="Fond coloré" label="Fond coloré"
/> />
<ToggleGroupControlOption
value="framed-backgrounded"
label="Cadre + fond coloré"
/>
</ToggleGroupControl> </ToggleGroupControl>
<ToggleGroupControl <ToggleGroupControl
label="Largeur du bloc" label="Largeur du bloc"
@ -116,7 +120,8 @@ export default function Edit({ attributes, setAttributes, ...props }) {
<ToggleGroupControlOption value="full" label="Pleine largeur" /> <ToggleGroupControlOption value="full" label="Pleine largeur" />
</ToggleGroupControl> </ToggleGroupControl>
{blockVariant === "backgrounded" && ( {blockVariant === "backgrounded" ||
(blockVariant === "framed-backgrounded" && (
<Card> <Card>
<CardHeader> <CardHeader>
<h1>Couleur de fond</h1> <h1>Couleur de fond</h1>
@ -131,9 +136,11 @@ export default function Edit({ attributes, setAttributes, ...props }) {
</> </>
</CardBody> </CardBody>
</Card> </Card>
)} ))}
{blockVariant === "backgrounded" && postType !== "articles" && ( {(blockVariant === "backgrounded" ||
blockVariant === "framed-backgrounded") &&
postType !== "articles" && (
<Card> <Card>
<CardHeader> <CardHeader>
<h1>Couleur du texte </h1> <h1>Couleur du texte </h1>
@ -162,7 +169,10 @@ export default function Edit({ attributes, setAttributes, ...props }) {
style: { style: {
"--content-box-text-color": textColor ?? "inherit", "--content-box-text-color": textColor ?? "inherit",
"--content-box-background-color": "--content-box-background-color":
blockVariant === "backgrounded" ? backgroundColor : "transparent", blockVariant === "backgrounded" ||
blockVariant === "framed-backgrounded"
? backgroundColor
: "transparent",
}, },
})} })}
> >
@ -180,6 +190,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
"core/image", "core/image",
"core/buttons", "core/buttons",
"core/columns", "core/columns",
"core/file",
"core/post-title", "core/post-title",
"core/embed", "core/embed",
"core/quote", "core/quote",

View File

@ -20,7 +20,10 @@ export default function save({ attributes }) {
style: { style: {
"--content-box-text-color": textColor ?? "inherit", "--content-box-text-color": textColor ?? "inherit",
"--content-box-background-color": "--content-box-background-color":
blockVariant === "backgrounded" ? backgroundColor : "transparent", blockVariant === "backgrounded" ||
blockVariant === "framed-backgrounded"
? backgroundColor
: "transparent",
}, },
})} })}
> >