OllieWP / ollie

A finely-crafted WordPress block theme by Mike McAlister
https://olliewp.com
GNU General Public License v3.0
370 stars 49 forks source link

Question about margin-block-start #156

Open aksld opened 7 months ago

aksld commented 7 months ago

Hello,

I'm just starting out with Ollie.

I just want to modify my header. I've added a block cover. And above it a navigation block.

On the editor, I have a space above the navigation block. But not at the front.

The CSS rule applied is :

where(.wp-site-blocks) > * {
    margin-block-start: var(--wp--preset--spacing--medium);
}

Basically I can't adjust the margin of the navigation block. However, if I put a group block with a margin of 0 it's fine.

Is this the solution? Is it normal to have this upper margin applied by default on the editor and not on the front?

Thanks for your help :)

mikemcalister commented 4 months ago

Hey there,

Apologies for the late response!

I don't think this is an Ollie specific thing, this is more how the block spacing works in WP now. All blocks have a margin-block-start styling applied to give the page a vertical rhythm.

When you are designing with patterns or sections, generally you remove the top margin so those sections sit together nicely.

I can't see your specific situation, but what I would do is maybe group it together as you suggest. If I could see the full layout I could provide some more context. You may have this sorted out by now!