Site logo

Archived topic

GPP / Group block / Full-width / background color

5 replies · Started by Jan on May 24, 2021

Viewing posts 1–6 of 6

Hi David,

I added a number of group blocks to a page, set them to full width and added a background color. In the block-editor everything seems fine (see screenshot).

When I switch into preview-mode, however, the background color of the group-block is not visible.

Please let me know what I'm missing.

Many thanks,
Jan

PS: Tom talked about some extra CSS in this threat, but I'm not sure if this applies to my case here.

https://generatepress.com/forums/topic/full-width-container-boxed-content/

Hi there,

Is there a reason why group block is needed here?

You should be able to create the exact same layout by using the container block from GB only.

Let me know :)

Hi Leo,

Thanks for getting back.

Reasoning: I’d like to create all pages with the same page setting (boxed, not full-width). Some of the containers within a page, however, need to appear in full width.

I may be wrong but isn’t that what Tom suggested in the threat that I referred to earlier?

If not, then I’m happy to switch to your container based approach.

Please let me know how to proceed.

Thanks,
Jan

Hi Jan,

Reasoning: I’d like to create all pages with the same page setting (boxed, not full-width). Some of the containers within a page, however, need to appear in full width.

There's an alignment setting within Gutenberg that sets blocks to full width of the viewport. This particular setting actually exceeds the max-width imposed by the container width on customizer settings.

It's this one - https://share.getcloudapp.com/4gunArDO

Check this demo video - https://share.getcloudapp.com/o0ueyG4r

It's simply the alignfull class.

Which adds this CSS property:

.alignfull {
    margin-left: calc(-100vw / 2 + 100% / 2);
    margin-right: calc(-100vw / 2 + 100% / 2);
    max-width: 100vw;
    width: auto;
}

Hi Elvin,

this works well.

Thanks for your additional explanations.

Regards,
Jan

No problem. Always glad to be of any help. :D

This archived topic is closed to new replies.