Closed onuro closed 1 year ago
The background is neat š
A few thoughts on the heading.
Lastly, because this pattern uses a specific background image, I think it'd be safer to specify the colour of the text and button.
Thanks @iamtakashi . I've also updated the font with Poppins which felt better in bold.
Let's get this published!
Published!
I changed the category from Wireframe(default) to Newsletter. The category is important as that's where the pattern appears in the inserter. I know it's easy to forget :) The new template for new issues might remind us well.
Also, this pattern brings back the horizontal scroll bar again. I suspect this also has the same issue as https://github.com/Automattic/blockpatterns/issues/292. Can you take a look at it? Thanks in advance!
Changed it to a draft. Publish it and close this when the issue is solved.
@iamtakashi somehow wrapping the full width cover with group block causes this(theme has negative left/right margins for full width blocks).
I detached the cover from the wrapping group and it seems to fix it.
somehow wrapping the full width cover with group block causes this(theme has negative left/right margins for full width blocks).
@onuro You can still wrap it with the group block, but if you remove the default side paddings from it, the cover block inside becomes wider than the viewport.
@onuro You can still wrap it with the group block, but if you remove the default side paddings from it, the cover block inside becomes wider than the viewport.
@iamtakashi I figured it out: If the wrapping group block is already full width aligned, there will be no need to full align the contentsāunless "Inner blocks use content width" is activated.
And my blocks within the group for both this pattern and the other had full aligned inner blocks in them. Removing the full alignment seems to permanently fix it.
I figured it out: If the wrapping group block is already full width aligned, there will be no need to full align the contentsāunless "Inner blocks use content width" is activated.
@onuro, it depends :) In many themes including Blockbase, all Blockbase child themes, and TT2, you'd still need to make the cover block full width if you want it to be full width while it's wrapped with a full width group block. (and when "Inner blocks use content width" is unticked. shown in example 1 & 2)
As I said, you had paddings 0
for the group block while the cover block was also full width. Removing the paddings was what made the full width cover block wider than the viewport in those themes (example 3) Feel free to test with the following markup with those themes.
The reason why I said "it depends" was ,thankfully, this is not the case with Block Canvas nor Blank Canvas 3. However, there are still many sites with TT2, Blockbase, and its child themes so we should avoid doing that.
<!-- wp:group {"align":"full","backgroundColor":"primary","textColor":"background","layout":{"type":"default"}} -->
<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background"><!-- wp:paragraph -->
<p>1. Full-width Group </p>
<!-- /wp:paragraph -->
<!-- wp:cover {"overlayColor":"foreground"} -->
<div class="wp-block-cover"><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim-100 has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write titleā¦","fontSize":"large"} -->
<p class="has-text-align-center has-large-font-size">Cover without specific alignment </p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:cover --></div>
<!-- /wp:group -->
<!-- wp:group {"align":"full","backgroundColor":"primary","textColor":"background","layout":{"type":"default"}} -->
<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background"><!-- wp:paragraph -->
<p>2. Full-width Group </p>
<!-- /wp:paragraph -->
<!-- wp:cover {"overlayColor":"foreground","align":"full"} -->
<div class="wp-block-cover alignfull"><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim-100 has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write titleā¦","fontSize":"large"} -->
<p class="has-text-align-center has-large-font-size">Cover (full-width)</p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:cover --></div>
<!-- /wp:group -->
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"0px","left":"0px"}}},"backgroundColor":"primary","textColor":"background"} -->
<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background" style="padding-right:0px;padding-left:0px"><!-- wp:paragraph -->
<p>3. Full-width Group without default side padding</p>
<!-- /wp:paragraph -->
<!-- wp:cover {"overlayColor":"foreground","align":"full"} -->
<div class="wp-block-cover alignfull"><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim-100 has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write titleā¦","fontSize":"large"} -->
<p class="has-text-align-center has-large-font-size">Cover (full-width)</p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:cover --></div>
<!-- /wp:group -->
Screenshot:
Preview: https://dotcompatterns.wordpress.com/?p=7710&preview=true
@iamtakashi @alaczek