Color Component
Farbeinstellungen vornehmen
Last updated
Was this helpful?
Farbeinstellungen vornehmen
Last updated
Was this helpful?
Was this helpful?
const { ColorPalette } = wp.blockEditor;
const { PanelBody } = wp.components;
const { InspectorControls } = wp.editor;
/* Falls mal keine Standardfarben aus dem globalen Setting haben möchte, kann man
das verwenden */
const { ColorPalette } = wp.components;attributes: {
color: {
type: 'string'
}
} <Fragment>
<InspectorControls>
<PanelBody title="Farben" initialOpen={ true }>
<ColorPalette
className="bz__colors-palette"
color={ props.attributes.color }
onChange={ ( color ) => {
props.setAttributes( {
color: color
});
}}
/>
</PanelBody>
</InspectorControls>
<h4 style={ { color: props.attributes.color } }>
Headline
</h4>
</Fragment>