Archived topic
Global styles with two blocks
11 replies · Started by Robert on March 16, 2022
Hi there,
I'm trying to create a global style for a common container I use. Here are the steps I'm using:
Create new global style with a container and a grid block inside
Add a blank image block as a placeholder on the left side with no padding, and text block on right with 15px padding
I also add a 1px border around the top container
The problem is when I try to apply the global style in a post it has the main container with a border and that's it..no grid or other blocks, padding etc...
Since I have a lot of step-by-step tutorial guides I was hoping to create a global style that may help load speed etc...
Link to example: https://www.painthog.com/get-started-with-abstract-acrylic-painting-step-by-step-tutorial/
Any suggestions on how to go about this? Thanks
Thanks
Hi there,
this is really a question for the GenerateBlocks support... but to cover:
1. Global Styles only apply to the individual block.
2. Therefore you need to add individual styles to each block.
and to make workflow easier
3. Once you created your global styles, create a Local Template and apply the global styles.
Now you can import the Local Template to the page.
sorry, about that! I have a follow up question, shall I move the topic over the generateblocks support forum?
You can ask it here :) I wont tell if you dont lol
Oh thanks. Thought I'd be blocked for generateblocks :)
The info helped.
If I build custom containers with inside grids and padding, (all with global styles like border etc), can I build only one and duplicate it? Does this add unnecessary code? Or, should I build each one separately? The reason I ask is I've been watching the YT vids and I seem to remember being told not too copy/paste blocks with global styles. thanks
Global Styles with Grids are a little bit of a mind bender. As you can't cascade a global style.
So I would:
1. Create a Global Style
2. Add a Grid Block, with a Single column, style that and apply the Global Style class name to it.
Now when i build my Local Template i would add a Single column Grid, apply the Global Style to that single column container and then Duplicate the columns from the Grid toolbar.
I was hoping to add a 1px border around the grid, but I don't see where grids offer that. Which is why I started with a container...Am I missing something?
Here's an example post of what I'm trying to do, just gotta scroll down to see it; https://www.painthog.com/how-to-mix-acrylic-paint-for-beginners/
The Grid Block itself is simply a wrapper it doesn't have borders etc.
You would add the Grid inside a Container Block to do that
Okay, I see.
So, once I build a grid and style it. Then follow your directions for creating template, I can then build one grid and duplicate it with causing any issues? Thanks again, you're very helpful and patient
Yeah, that should work :)
Great! Thanks so much, love the theme, blocks and support!
Awesome - thanks for the great feedback !