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
- Gutenberg: Block validation failed
- Change order/position of Gutenberg inspector control panel
- serialize_blocks breaking html tags in content
- Hide or show Gutenberg custom block using date range
- Use page Title in Gutenberg custom banner block
- How to add code to `head` with WordPress 5.9 FSE (Full Site Editing)
- Block Editor: add an aria-label to an option inside a SelectControl
- How to make the Preview button automatically open new tab?
- Gutenberg: How can I disable backspace key from deleting an empty paragraph block?
- Possible add color palette for a block’s inner div instead of outer?
- Programmatically trigger the gutenberg save
- Gutenberg : in the backend, I just want to store a JSON object
- wordpress gutenberg url popover custom options
- Text Editors Are Hiding Text
- Disabling deleting reusable blocks except on the reusable block manager
- Gutenberg remove Most Used group
- Gutenberg. How To Register A Custom Block Style For Specific Post Type Only
- get used blocks in post and detect changing
- How to know whether you are editing a page or a post?
- Gutenberg get block name
- Insert SVG code (not img) in HTML block
- How to enable Block Editor on the Posts page
- React to a change of the block alignment
- Object type for block Attribute (Gutenberg)
- Guttenberg Implementation on Front Page
- Register multiple styles / scripts in register_block_type
- How to automatically remove noreferrer from targetd link rel attribute, on render?
- Should there be concern about breaking Gutenberg updates to extended core blocks?
- How do I access onMerge, onReplace, onRemove functions for a Rich Text component in Gutenberg block code?
- How can Reusable Blocks be fully deleted?
- Make a Gutenberg Block that do WP_User_Query
- Extend Gutenberg block core/quote block
- How to get all attributes of a block in PHP?
- Gutenberg Block Get Author Details
- Gutenberg Block Toolbar – remove button
- WordPress block editor embeds not working in theme (single.php)
- Cannot enable Gutenberg editor [closed]
- Remove ‘type / to choose a block’ placeholder [duplicate]
- Start a line with – without converting to list
- Quickest way of developing custom Gutenberg Blocks
- How to register two blocks in the same plugin
- Gutenberg: always show text color selector in editing bar
- How to lock innerBlocks within a block variation?
- How to get startIndex and endIndex from the selected block in gutenberg?
- Set a minimum and maximum limit of images to select in the MediaUpload component for Block
- Compile a blocks src directory and main index.js entry file and output to different build dirs?
- Proxy External API request in PHP from Edit.js in Block Plugin
- How do I stop a dynamic Gutenberg component from re-rendering on every keystroke?
- Leave focus on custom Gutenberg block when pressing enter
- How to Analyze Blocks and find Intersection and patterns between pages
- WordPress does not hide content after “Read more” block added using gutenberg editor
- Issue with translation – Gutenberg
- RSS feed WP widget vs Gutenberg Block?
- Gutenberg editor failing to load correctly after new theme install
- Gutenberg Custom Style problem with background image
- Theme options missing from edit page
- “Updating failed” if any text includes “$v()”
- Disable Font Size for Authors using: add_theme_support(‘disable-custom-font-sizes’);
- Multiple checkboxes Gutenberg control
- Block validation failed
- Loading column block style seperately
- How to use react in frontend of dynamic blocks?
- Attempting to specify viewScript, in a custom block, results in a register_block_script_handle error
- What is the standard way to use the version of React that ships with Gutenberg on the front end?
- Restricting core block nested blocks
- Is is possible to use Templates with blockprops?
- How to add readable name and description to templates?
- Errror generated in console leading to block validation failer
- Add Custom Block Supports to Core Block
- Block validation failed – save content vs post body content
- How to propegate changes from block render_callback to other blocks using that callback?
- wordpress 6.2 is alignfull and lignwide removed?
- How to add “rel=nofollow” for links in latest version of WordPress?
- I can’t highlight/select text in the RichText components in my Gutenberg blocks
- Lazy load video block while keeping autoplay
- Is it possible to add custom Components in the InspectorControls to the new “Styles” Tab?
- How to implement Mapbox GL JS with a custom Gutenberg block in FSE?
- Hard code block with nested block in front-page.html template
- Use a custom block inside another custom block
- Controlling or disabling Gutenberg editor panning/focus on a custom slider block
- Default value for highorder component in Gutenbrg?
- Custom gutenberg block: window.wp.blockEditor returns undefined
- How can I add a wrapper class to individual blocks inside of an InnerBlocks component?
- how can I remove all default settings in Gutenberg blocks? example core/button
- How do i create a switch for responsive devices?
- Are shortcodes now allowed in synced blocks?
- How to get block editor block inspector attribute value in my react block
- Modifying other core editor panels besides Featured Image in the block editor
- Detecting whenever a user types – in the Gutenberg editor, and checking if there is a preceding or succeeding – then converting both to an em dash