Slide 47
Slide 47 text
import { registerBlockExtension } from '@10up/block-components';
function BlockEdit(props) {...}
function generateClassNames(attributes) {...}
registerBlockExtension(
'core/group',
{
extensionName: 'background-patterns',
attributes: {
hasBackgroundPattern: {
type: 'boolean',
default: false,
},
backgroundPatternShape: {
type: 'string',
default: 'dots',
},
backgroundPatternColor: {
type: 'string',
default: 'green'
}
},
classNameGenerator: generateClassNames,
Edit: BlockEdit,
}
);
47