Description
JSON files in theme styles folder used to register if you only had a title and slug property (along with blockTypes), this would add the CSS class to the block and allow you to style externally or hook into with JavaScript, etc.
Now it seems those files are ignored unless you specify an external stylesheet in the JSON or you use some kind of style in the schema.
Step-by-step reproduction instructions
- Create
theme/styles/blocks/gallery-1.json
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"title": "Slideshow",
"slug": "slider",
"blockTypes": [
"core/gallery"
]
}
- Load admin, insert Gallery block, notice there is no style option for "Slideshow"
- Add
styles to JSON
"styles": {
"spacing": {
"padding": {
"top": "0"
}
}
}
- Reload admin, you'll see "Slideshow" as option for style
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
Description
JSON files in theme
stylesfolder used to register if you only had atitleandslugproperty (along withblockTypes), this would add the CSS class to the block and allow you to style externally or hook into with JavaScript, etc.Now it seems those files are ignored unless you specify an external stylesheet in the JSON or you use some kind of style in the schema.
Step-by-step reproduction instructions
theme/styles/blocks/gallery-1.json{ "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 3, "title": "Slideshow", "slug": "slider", "blockTypes": [ "core/gallery" ] }stylesto JSONScreenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.