UNPKG

@wordpress/block-editor

Version:
38 lines (34 loc) 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSpacingClassesAndStyles = getSpacingClassesAndStyles; var _style = require("./style"); /** * Internal dependencies */ // This utility is intended to assist where the serialization of the spacing // block support is being skipped for a block but the spacing related CSS // styles still need to be generated so they can be applied to inner elements. /** * Provides the CSS class names and inline styles for a block's spacing support * attributes. * * @param {Object} attributes Block attributes. * * @return {Object} Spacing block support derived CSS classes & styles. */ function getSpacingClassesAndStyles(attributes) { const { style } = attributes; // Collect inline styles for spacing. const spacingStyles = style?.spacing || {}; const styleProp = (0, _style.getInlineStyles)({ spacing: spacingStyles }); return { style: styleProp }; } //# sourceMappingURL=use-spacing-props.js.map