1

I'm trying to create a full width blocks for the new Gutenberg editor, however I don't want to give to option to toggle the block alignment (eg: like the Cover block does) just make it full width all the time.

I managed to add support for this with the supports flag in my block:

supports: {
    align: ['full']
}

attributes: {
    align: {
        type: 'string',
        default: 'full'
    }
}

This shows the block in the admin area as full width by default but it also displays the Block Alignment Toolbar at the top so it can be toggled on/off:

gif

Is there a way to set the block alignment without displaying the toolbar?

1
  • This was answered over here. wordpress.stackexchange.com/questions/325724/… ... It's the only way I've seen to make this work without scroll bars in Windows / Linux systems that have proper vertical scrollbars (which are what cause the horizontal scrollbar).
    – Trevor
    Mar 19, 2019 at 10:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.