-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Block, theme.json definitions not loaded with latest RC Gutenberg Plugin #43679
Comments
Hi @SGr33n, would you be able to provide some more detailed steps for reproduction. Either fuller code snippets that a developer can paste, or a link to another repo/plugin that has the problem. Thanks. |
Hi @talldan! |
I was able to reproduce it. Test Code
import { registerBlockType } from '@wordpress/blocks';
import { useBlockProps } from '@wordpress/block-editor';
import metadata from './block.json';
registerBlockType( metadata.name, {
edit: () => <p { ...useBlockProps() }>My Custom Block</p>,
save: () => <p { ...useBlockProps.save() }>My Custom Block</p>,
} );
{
"apiVersion": 2,
"name": "create-block/test-block",
"title": "My Custom Block",
"category": "text",
"textdomain": "test-block",
"editorScript": "file:./index.js"
}
{
"version": 2,
"styles": {
"blocks": {
"core/heading": {
"border": {
"width": "3px",
"color": "#f00",
"style": "solid"
},
"color": {
"text": "#fff",
"background": "#000"
}
},
"create-block/test-block": {
"border": {
"width": "3px",
"color": "#f00",
"style": "solid"
},
"color": {
"text": "#fff",
"background": "#000"
}
}
}
}
} My test results show that when I activate the latest Gutenberg, the styles defined in d3401bd253dff73a7de297ef614c1343.mp4 |
@t-hamano exactly what happened to me. |
Sure, thanks @t-hamano ! |
Description
Hi,
I'm just trying the latest Gutenberg RC and I can see that something is not working anymore.
The issue is that I created a custom excerpt block, called theme/single-post-excerpt and I added some css to the theme.json:
"theme/single-post-excerpt": { "typography": { "lineHeight": "var(--wp--custom--typography--line-height--small)", "fontSize": "var(--wp--preset--font-size--large)", "fontWeight": "500" } }
That definitions works good on the latest WP 6.0.1 but if I install the latest Gutenberg RC they are ignored.
Step-by-step reproduction instructions
Create a custom block.
Add css definitions for that block on the theme.json
Check if they are applied.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: