Replies: 1 comment
-
There is something in the works for alignments specifically. You can see it in use on the buttons block here to disable alignments on inner button blocks: gutenberg/packages/block-library/src/buttons/edit.js Lines 24 to 27 in a304131 gutenberg/packages/block-library/src/buttons/edit.js Lines 53 to 64 in a304131 This prop is an experimental API, so it's very risky to use it at the moment. The API could be renamed or changed without much notice. This is particularly risky if you're a plugin developer, as your plugin will have to be updated the moment this API becomes stable, but you might also have to support both the experimental and stable versions of it as you won't have much control over the version of the block editor users are running. If you're just developing blocks for your own site and you have more control over when you update things, then it might be more acceptable risk. I leave it up to you, but at least you know what to look out for now when this API does become stable. |
Beta Was this translation helpful? Give feedback.
-
Hello! I am wondering if there is a way to disable certain block attributes of allowed
innerblocks
.For example, I have a custom sidebar block that accepts images as an innerblock. I generally like that images have alignment options, but I don't like how they have alignment options within my sidebar block. I can obviously override any styles associated with aligned images within my sidebar block, but that seems like a not ideal solution. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions