Home Forums Weaver Xtreme Theme Remove #content [class^=wp-block-] {margin-bottom:2.5em;margin-top:1.2em;}

  • This topic has 3 replies, 3 voices, and was last updated 5 months ago by Ned.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #61715

    I’m using the Getwid – Gutenberg Blocks plugin (https://wordpress.org/plugins/getwid/) which allows different margin, padding, etc. settings for different blocks and different instances of blocks.

    Then the Weaver Xtreme theme CSS overwrites all the margin settings for all the blocks with:

    #content [class^=wp-block-] {margin-bottom:2.5em;margin-top:1.2em;}

    which wreaks havoc with the layout.

    In this post, https://forum.weavertheme.com/forums/topic/block-borders-and-shortcut-boxes-not-visible-in-edit-mode/, Scrambler notes:

    Weaver has a rule that adds a Top (1.2em) and bottom (2.5em) margin to blocks.

    He is thinking of making it a changeable option, but for now, you can add the rule below in the Theme Global Custom CSS rule box, and change its value to reduce or remove it.

    #content [class^=wp-block-] {margin-bottom:0;margin-top:0;}

    However, that is just another blanket overwrite of ALL the block margins with a different value, so that doesn’t help in my case.

    How can I remove that line of CSS? With a child theme, or is there an easier/better way?


    You cant remove the CSS, you can only overwrite it with a new rule.


    The plugin probably needs to be updated to handle themes that provide block margins as part of the theme.

    If that plugin is providing classes to add margins and padding to blocks, then their rules may need to be made stronger, perhaps including !important.

    In general, it is the responsibility of a plugin to be sure to really override theme styling if necessary. There is a very long history of plugins getting the styling wrong and not creating “strong” enough CSS to do what they really intend.

    I think you need to contact the plugin authors for this.


    Thank you, Scrambler and Weaver for your prompt and pertinent replies.

    I took some time to educate myself on child themes. Yep, doesn’t seem possible to have the child theme CSS “undo” a parent theme CSS rule, just overwrite it.

    I read up some on adding wp_enqueue_ actions to control the priority of stylesheet loading, then maybe wp_dequeue_style and deregister some of the parent stylesheets… and, not having done it before, it’s more than I’m up for.

    My resolution for the sites where I want to use the Getwid plugin, https://wordpress.org/plugins/getwid/ , is to switch to their https://wordpress.org/themes/getwid-base/ theme, which was built to integrate with the plugin.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.