@wordpress/block-library
Version:
Block library for the WordPress editor.
30 lines (29 loc) • 1.19 kB
JavaScript
// packages/block-library/src/tabs-menu-item/save.js
import { __ } from "@wordpress/i18n";
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,
hidden: true
});
return /* @__PURE__ */ jsx("a", { ...blockProps, children: /* @__PURE__ */ jsx("span", { className: "screen-reader-text", children: __("Tab menu item") }) });
}
export {
save as default
};
//# sourceMappingURL=save.mjs.map