They’re defined the same way they always have been, in a CSS file.
Do what styling you can using the block editor and theme.json
then supplement it with additional CSS in a CSS file. You can enqueue it the same was as a classic theme in functions.php
, and if it’s a minor change there’s a custom CSS option in the site editors global styles section.
Block styles and block variations may help here by providing useful point and click UIs that automatically add the HTML classes you need so the user doesn’t have to type them out themselves. You might also find that using the built in layout functions might interfere, e.g. if you were defining flexbox layouts and grid layouts for a group block it would not make sense to turn it into a grid/row/stack.
Enqueue your CSS file the same way you would have done in a classic theme, just be sure to also add it as an editor stylesheet so that the site editor displays things correctly.
Related Posts:
- WordPress Gutenberg Embed Blocks Are Not Responsive
- Once Again: How to Remove Option from Gutenberg Editor for Specific Block in theme.json
- How can I add a color picker to a custom Gutenberg block which includes the default system palette from theme.json?
- Setting font sizes in theme.json
- Is it possible to disable font sizes on sub blocks only?
- How to set the background color of a template part (Header/Footer) in Twenty Twentythree?
- How to automatically reload style variant .json?
- How can I disable fontSizes of the Paragraph block inside the Quote block with theme.json?
- Different style options for the same block depending where it is used
- Gutenberg – Shadow settings not available (theme.json)
- Theme.json: styles.typography.FontFamily renders as default font in front end but not editor
- Override base Gutenberg block default spacing in child theme’s theme.json
- Set a default overlay color for the Core Cover block in theme.json
- Where can I find the Gutenberg block icons?
- Add pre-publish conditions to the block editor
- How to filter or remove default panels in Gutenberg PrePublish Panel
- Deactivate Gutenberg tips forever – not Gutenberg
- How does Gutenberg handle translations in React?
- Add To Gutenberg Sidebar
- How to detect the usage of Gutenberg
- Integrate Gutenberg as a Standalone App
- Help Unregistering a Core Block Type in Gutenberg
- How do I register multiple blocks with block.json and register_block_type_from_metadata?
- Remove block styles in the Block Editor
- Disable Gutenberg text-Settings in all blocks
- How do I get the current post ID within a Gutenberg/Block Editor block?
- Looking for all available options of Gutenberg Block
- Possible to use @wordpress/create-block with multiple blocks?
- Are there ways to make the Gutenberg editor wider? And the HTML-block higher?
- Blocks: set a default value for a TextControl
- gutenberg block – how to force update after attribute changed?
- What is the advantage of ‘register_block_type’ (the PHP function) when creating custom blocks?
- How to trigger JS in gutenberg page load
- Allow excerpt for pages in Gutenberg?
- Is there a list / reference for all current native WordPress blocks?
- Gutenberg: Block validation failed
- Set fullscreen mode by default
- How to query multiple post types inside Gutenberg options panel?
- How can I add a custom attribute to Gutenberg core blocks?
- Gutenberg extend core blocks
- Setting default font family with theme.json
- How can I access core/paragraph textColor in a block template
- (Gutenberg Block Editor) Using editor.BlockEdit filter, need to alter html/ CSS class of BlockEdit Component
- Add Button To Top Toolbar in Gutenberg
- Saving post meta using the new EntityProvider APIs
- Disable device preview options in the block editor
- Add additional classes to gutenberg .editor-styles-wrapper
- Implementing Gutenberg RichText onSplit / onReplace
- Change order/position of Gutenberg inspector control panel
- Get the current block ID
- Gutenberg Inspector Controls
- How to use the WordPress < LinkControl /> Component
- What version of Gutenberg is included with WordPress?
- Implement Panel Color Inspector Control in Gutenberg
- Add Formatting Buttons to Gutenberg core/paragraph BlockControls
- How do you use __experimentalLayout to give innerblocks alignment control and default layout?
- WordPress Value of Undefined in Admin
- Remove border radius setting from the Gutenberg button block?
- Extending Gutenberg group block: How to properly combine multiple attributes?
- serialize_blocks breaking html tags in content
- All post types with getEntityRecords
- gutenberg dynamic block is returning 404
- Modify the core/paragraph block
- Add PHP block template to content using wp_insert_post
- The Block Editor: Disable “Color settings” in the specific block
- Required (mandatory) Gutenberg block
- How to use getBlockIndex
- Gutenberg reusable blocks – is it possible to customise an instance?
- Gutenberg InspectorControls is deprecated, how to add custom block settings?
- Add classname to Gutenberg block wrapper in the editor?
- Hide or show Gutenberg custom block using date range
- How to disallow a certain custom gutenberg block outside of an InnerBlocks block?
- How should you internationalize javascript spread in multiple files but build in one?
- Use page Title in Gutenberg custom banner block
- How to add code to `head` with WordPress 5.9 FSE (Full Site Editing)
- Why is onChange={ ( content ) => setAttributes( { content } )} now used?
- Serialize custom block with InnerBlock
- How to develop custom blocks without triggering validation errors
- Dynamic gutenberg block with react instead of php
- get selected categories or tags (using javascript) in GutenBerg?
- File structure and react setup when creating multiple Gutenberg blocks
- Block Editor: add an aria-label to an option inside a SelectControl
- WordPress Gutenberg blocks: Input fields are not editable
- Gutenberg withInstanceId. When to use it?
- Gutenberg: Get All Attributes From «core/image» Block
- What replaces wpColorPicker in Gutenberg?
- How to make the Preview button automatically open new tab?
- Help with using getBlockIndex
- How to set column widths in a CPT block template?
- Gutenberg: How can I disable backspace key from deleting an empty paragraph block?
- Access GutenBerg data with Javascript?
- Gutenberg moving core blocks between categories
- Only show focused toolbar for Gutenberg Block with Multiple text fields
- Gutenberg: How to Change Post Status Programmatically?
- What’s the recommended Gutenberg component for adding a URL, in the toolbar/sidebar?
- Gutenberg block get categories in SelectControl
- Gutenberg Range Control default from meta value
- Gutenberg blocks – processing server data within a block
- How to access “default” property of attribute in Gutenberg
- Adding a custom PanelColorSettings control to a core block, and using the color slug in a custom className