芝麻web文件管理V1.00
编辑当前文件:/home/r5772835/public_html/ycreate.jp/wp-content/plugins/snow-monkey-blocks/src/blocks/box/save.js
import classnames from 'classnames'; import hexToRgba from 'hex-to-rgba'; import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor'; export default function ( { attributes, className } ) { const { backgroundColor, backgroundGradientColor, borderColor, borderStyle, textColor, borderWidth, borderRadius, opacity, contentPadding, boxShadow, } = attributes; const styles = { '--smb-box--color': textColor || undefined, '--smb-box--border-radius': String( borderRadius ).match( /^\d+$/ ) ? `${ borderRadius }px` : borderRadius, '--smb-box--box-shadow': !! boxShadow.color ? `${ boxShadow.horizontal }px ${ boxShadow.vertical }px ${ boxShadow.blur }px ${ boxShadow.spread }px ${ hexToRgba( boxShadow.color, boxShadow.opacity ) }` : undefined, '--smb-box--background-color': backgroundColor || undefined, '--smb-box--background-image': backgroundGradientColor || undefined, '--smb-box--background-opacity': String( opacity ), '--smb-box--border-color': borderColor || undefined, '--smb-box--border-style': borderStyle || undefined, '--smb-box--border-width': String( borderWidth ).match( /^\d+$/ ) ? `${ borderWidth }px` : borderWidth, }; const classes = classnames( 'smb-box', className, { [ `smb-box--p-${ contentPadding }` ]: !! contentPadding, } ); return (
); }