@wordpress/block-library
Version:
Block library for the WordPress editor.
30 lines (29 loc) • 1.07 kB
JavaScript
// packages/block-library/src/tabs-menu-item/save.js
import { useBlockProps } from "@wordpress/block-editor";
import { jsx } from "react/jsx-runtime";
function save({ attributes }) {
const customColorStyles = {};
if (attributes.customActiveBackgroundColor) {
customColorStyles["--custom-tab-active-color"] = attributes.customActiveBackgroundColor;
}
if (attributes.customActiveTextColor) {
customColorStyles["--custom-tab-active-text-color"] = attributes.customActiveTextColor;
}
if (attributes.customHoverBackgroundColor) {
customColorStyles["--custom-tab-hover-color"] = attributes.customHoverBackgroundColor;
}
if (attributes.customHoverTextColor) {
customColorStyles["--custom-tab-hover-text-color"] = attributes.customHoverTextColor;
}
const blockProps = useBlockProps.save({
className: "wp-block-tabs-menu-item__template",
style: customColorStyles,
type: "button",
role: "tab"
});
return /* @__PURE__ */ jsx("button", { ...blockProps });
}
export {
save as default
};
//# sourceMappingURL=save.mjs.map