Home>Support>Completly stop rendering the margin-bottom property in CSS?

Completly stop rendering the margin-bottom property in CSS?

Hello everybody,

we are about to use the builder in our upcoming projects. We really like the drag & drop interface. But we were wondering, how we can stop the builder from rendering the margin-bottom property for each class=so-panel. I know, that I can set this property globally in the builder settings. But this doesn’t help, because I can only enter “0px”.

When the CSS code is rendered for each site, the panels parent CSS IDs also get rendered.

Example:

#pl-179 .panel-grid-cell .so-panel

Thus it’s impossible to adjust these settings in the style.css in my theme: it gets overwritten by the higher specificity of the id-property. And also because the rendered CSS Code is rendered in the head of each site.

My Question: Is there a way to completely stop rendering the margin-bottom?

I already discovered the documentation and section about filtering the CSS (https://siteorigin.com/docs/page-builder/hooks/css/). But I didn’t find any help on my specific question.

Any ideas, anybody?

Greetings from Berlin/Germany
Lukas

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 3 months ago Alex S
    Hi, I Work Here

    Hi Lukas,

    Could you clarify why you’re unwilling to use the row bottom margin setting? It’s doing exactly what you want so I’m not too sure why that’s not the ideal method for you. (just to clarify, please ensure you don’t input a unit of measurement into that field).

    • 8 years, 3 months ago eigenstil

      Hey Alex, thank you for your answer!

      (Just to clarify: I didn’t put a measurement into that field, just the number 0.)

      I don’t want to use the row bottom margin setting, because I want to specify all the margins ONLY in my CSS-file.

      The reason behind this is: I want to specify different margins for different modules. For example all images (.widget_sow-image) should have 0.5em margin but all normal text-editors (.widget_sow-editor) should have 1.5em margin.

      This is not possible, if the margin-bottom property gets rendered for each id, because of the specificity order in CSS.

      Which brings me back to my question: can I somehow completly stop the builder to render the margin-bottom property?

  2. 8 years, 3 months ago Alex S
    Hi, I Work Here

    Hi Eigenstil,

    Sorry for the delay. I’m going to forward this to the development team. Hopefully they’ll be able to help you with this.

  3. 8 years, 3 months ago Alex S
    Hi, I Work Here

    Hi Eigenstil,

    Please try the following PHP:

    function so_remove_bottom_margin(){	return;}add_filter( 'siteorigin_panels_css_row_margin_bottom', 'so_remove_bottom_margin' );add_filter( 'siteorigin_panels_css_cell_margin_bottom', 'so_remove_bottom_margin' );add_filter( 'siteorigin_panels_css_cell_last_margin_bottom', 'so_remove_bottom_margin' );

    Technically this works by outputting an invalid value, which is a bug. This will be fixed in the next version (as in no CSS will be output) but at least for the time being it works.

    • 8 years, 3 months ago eigenstil

      Hey Alex,

      thank you very much for he solution – this works (although it’s not the best CSS driven way).

      I’m really looking forward for the coming update!

      Greetings from Berlin, Lukas

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More