Global Margin & Padding of certain Elements (Headings, Text, Container)

I’m doing my first steps in Bricks Builder. Before I request my issue as feature or submit it to the ideas, I won’t to ask here - maybe I just can’t find it.
In this case I made a list of all Elements of the plugin Bricksable. I have containers and each container starts with a (H2) Heading. Now I want to add Margins to each Heading or i.e. Paddings to every Container (in second level).
I discovered the Page Settings > Theme Styles - but here I can only set Margins for any Element and i.e. in the Element Heading specific section I can only add a Separator but no Margins or Paddings. In “Typography” is nothing about it, too.
I hope my question is clear.

You can see the actual site here: https://bricks.flextensions.com/79/

1 Like

Hi flex,

You’re right. There are no global options except for margins for every element and margins for the root container.

But you have at least two options to achieve your goal:

  1. Create utility classes for your margins and paddings and apply those classes to your elements
  2. A few lines of custom CSS will work, of course, too.

Add this to the custom CSS of the outer container (for example):

root .bricks-container {
  padding: 4rem 2rem;
}

root .bricks-container .bricks-heading {
  margin-bottom: 2rem;
  color: red;
}

Best regards,
timmse

1 Like

Thanks for your answers!

  1. I’m lazy (only a lazy programmer is a good programmer :stuck_out_tongue_winking_eye:) and I don’t want to add a class to each (9) Heading elements.
  2. In this case I tried to think as a Webdesigner - such as my colleagues - and it would be a nice to have, to be able to set the margins and paddings especially for paragraphs and heading by the editor - like you would do it without a page builder.

Now I set the margins with CSS as you suggested at the top level Container by root .bricks-container .bricks-heading and it works fine.


Now I ran into another issue and I don’t want to start a new thread, so maybe you can note it from here @timmse :
Trying to find global margins for headings, I found the global separator for headings which I set via (Page) Settings > Theme Style > Element - Heading > Separator and I kind’a like it. But now I discovered a separator span even at the header heading:
image

I think this a bug because the Page Theme Styles should not affect the header or footer. Of couse I could hide the span with CSS, but I don’t think this is intended. The dashed lines are not shown only because the width of #bricks-element-xuqjir is auto and not 100%.

Hi flex,

Theme style settings apply globally for every element, no matter where the element is located. This is the intended behavior. You can get around this for your header in multiple ways:

Use the post title element instead of the heading element
Use the basic text element, set the HTML tag to custom and the tag to h1 or h2

The question is, how often and for what reason do you use static headings in your header template?

Best regards,
timmse

1 Like

Hi timmse,

okay, I did the - for me still - “workaround”. Yeah in the Header you can avoid it easily.
But here I’ve got an example of Bricks Builder’s own website:
image

All the Headings in the 4 columns of the Footer of bricksbuilder.io are Heading Elements, so they would be affected, if you would set a special Theme Style for Headings of a specific page.
And I still think that’s not intended.

Being at the footer, I just wanted to add a © with the current year by a Dynamic Data Value, but I can only select the {current_date}. Are thinking about extending the Dynamic Data choices?
I hope it’s okay to jumps from one subject to another - otherwise feel free to move it.

I just use a rich text field in the footer with Copyright AJ 2021 - {current_date:Y}
Works for me.

3 Likes

Hey,

True, but we are not using the separator :wink: If so, we would probably use the basic text element. I understand your approach, but it’s not like there are no solutions (in this case, even some that work without custom code). In general, it isn’t easy to cover every imaginable scenario.

As Alan already mentioned, you can extend some dynamic tags.
Please check out this Bricks academy article: Dynamic Data – Bricks Academy

1 Like

Okay, @alanj, the whole Dynamic Data is great - especially compared to Elementor.
Is there any scope for example to calculate or to set any conditions?

@timmse, at least you understand me and your point is perfectly fine.