Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Default block margin CSS is too specific

  • Custommizer > Typography > Body > Paragraph Margin adds this CSS to “generate-style-inline-css”:

    p{margin-bottom:[value];}.entry-content > [class*="wp-block-"]:not(:last-child):not(.wp-block-heading){margin-bottom:[value];}

    That is fine for the p tag, but way too specific for other blocks. That is the equivalent of 4 class names for the default margin of every block (other than headings). Defaults should have quite low specificity. This leads to the use of !important or redundant selectors in child themes to override GP for theme or plugin elements or to fix unexpected margins (on cover blocks and spacers, for example).

  • Hi there,

    You can use this snippet to remove the CSS:
    add_filter( 'generate_do_wp_block_margin_bottom', '__return_false', 99 );

  • Thanks!

  • No Problem 🙂

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