FEATURE Handling email button variation

This commit is contained in:
Antoine M 2026-05-05 14:57:31 +02:00
parent 7bb9b66b5f
commit e159cb4ba0

View File

@ -1,4 +1,18 @@
wp.blocks.registerBlockStyle("core/buttons", { import { registerBlockStyle, registerBlockVariation } from "@wordpress/blocks";
registerBlockStyle("core/buttons", {
name: "big-buttons", name: "big-buttons",
label: "Grands boutons ", label: "Grands boutons ",
}); });
registerBlockVariation("core/button", {
name: "email-button",
title: "Bouton email",
description: "Ajoute une icone email devant le texte.",
attributes: {
className: "email-button",
},
isActive: ({ className = "" }) =>
className.split(/\s+/).includes("email-button"),
scope: ["inserter", "transform", "block"],
});