@wordpress/block-library
Version:
Block library for the WordPress editor.
21 lines (18 loc) • 555 B
JavaScript
/**
* External dependencies
*/
import classnames from 'classnames';
/**
* WordPress dependencies
*/
import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
export default function save( { attributes, className } ) {
const { fontSize, style } = attributes;
const blockProps = useBlockProps.save( {
className: classnames( className, {
'has-custom-font-size': fontSize || style?.typography?.fontSize,
} ),
} );
const innerBlocksProps = useInnerBlocksProps.save( blockProps );
return <div { ...innerBlocksProps } />;
}