You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom CSS cannot be used with original blocks lacking block.json #75766
While custom CSS appears to be enabled in WordPress 7.0,
it does not function properly with older original blocks lacking block.json.
Please consider either providing backward compatibility support or disabling customCSS entirely.
Step-by-step reproduction instructions
For original blocks without block.json,
the custom CSS input field appears.
Entering CSS works in the admin interface, but viewing the code editor shows the CSS is not applied.
Since the CSS is not applied on the frontend, the display is not correct.
Screenshots, screen recording, code snippet
No response
Environment info
WordPress 7.0-alpha
Theme Twenty Sixteen
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
Please confirm which theme type you used for testing.
I'm sorry, but there are no blocks I can share.
What we currently know is
the case where block.json is not used with server-side rendering.
Also, adding
style: {
type: ‘object’,
},
to the attributes makes it display correctly, but I'm not sure if this is correct.
As I mentioned earlier, I believe it is undesirable to force existing blocks that have been functioning normally to be modified simply because they lack a block.json file.
The underlying problem doesn't seem to be related to block.json. Perhaps the results differ depending on whether or not the attributes.style object is present.
Try these steps:
Run the code in your browser console and register the custom block.
Both have been verified to work.
I don't understand why adding color makes it work, but since it seems you're accommodating this as backward compatibility as requested, I appreciate it.
Activity
Mamaduka commentedon Feb 20, 2026
cc @glendaviesnz
@nendeb, can you share an example block? While
block.jsonis nice to have, it's not required, and the same configuration can be done via PHP.nendeb commentedon Feb 20, 2026
cc@glendaviesnz
Thank you.
I'm sorry, but there are no blocks I can share.
What we currently know is
the case where block.json is not used with server-side rendering.
Also, adding
to the attributes makes it display correctly, but I'm not sure if this is correct.
As I mentioned earlier, I believe it is undesirable to force existing blocks that have been functioning normally to be modified simply because they lack a block.json file.
Please consider how to address this.
t-hamano commentedon Feb 21, 2026
The underlying problem doesn't seem to be related to
block.json. Perhaps the results differ depending on whether or not theattributes.styleobject is present.Try these steps:
The following code does not work with custom CSS:
The following code works with custom CSS:
Custom CSS support can be disabled.
nendeb commentedon Feb 21, 2026
t-hamano
Thank you.
attributes: {style: {}},
supports: {color: {text: true},
Both have been verified to work.
I don't understand why adding color makes it work, but since it seems you're accommodating this as backward compatibility as requested, I appreciate it.