carhop__plugins__PROD-DEV/plugins/carhop-blocks/blocks/content-card/src/save.js
2025-07-16 10:39:30 +02:00

29 lines
740 B
JavaScript

import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
import { isColorLight } from "../../_utilities/utilities";
export default function save({ attributes }) {
const { backgroundColor, textColor, hasLightBackground, hasBackgroundColor } =
attributes;
return (
<div
{...useBlockProps.save({
className: `content-card ${
hasLightBackground
? "content-card--bg-light"
: "content-card--bg-dark"
}`,
style: {
"--content-card-text-color": textColor ?? "inherit",
"--content-card-background-color": hasBackgroundColor
? backgroundColor
: "transparent",
},
})}
>
<div className="content-card__innerblocks">
<InnerBlocks.Content />
</div>
</div>
);
}