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

View File

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