mailchimp / wordpress

Add a Mailchimp signup form widget to your WordPress site.
https://wordpress.org/plugins/mailchimp/
GNU General Public License v2.0
1 stars 0 forks source link

Ensure consistent header and sub header spacing between block and shortcode output #41

Closed dkotter closed 3 months ago

dkotter commented 3 months ago

Description of the Change

As described here, there's a slight difference in spacing when using the shortcode block vs the normal block. This will vary based on the theme you're using, as this spacing isn't something we are adding. But in testing some of the core themes, what's happening here is the shortcode output does not have a wrapping container around things and there's some styling that gets applied to all direct children of the main content area.

This PR fixes things by adding in a wrapping container if a custom container isn't being used (when used as a normal widget in a widget area, there is already a wrapper so we don't want to double wrap). This removes this extra spacing. We also are adding some top margin on the sub-header to match the bottom margin that already existed there.

Partially closes #37

Block output Shortcode output

How to test the Change

  1. Install, activate and configure the plugin
  2. Create a new page and add a Mailchimp Block and a Shortcode Block with the Mailchimp shortcode
  3. View things on the front-end and note that there should be a container around both blocks and the spacing between the header and sub-header should match
  4. If desired, use a widget enabled theme and add the Mailchimp widget into a widget area. Ensure things display correctly there as well

Changelog Entry

Fixed - Ensure the custom block and shortcode both have consistent spacing

Credits

Props @dkotter, @qasumitbagthariya

Checklist: