-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blank Canvas Blocks: Added Block Patterns #3514
Conversation
<!-- /wp:image --> | ||
|
||
<!-- wp:heading {"textAlign":"center","level":1,"textColor":"almost-black"} --> | ||
<h1 class="has-text-align-center has-almost-black-color has-text-color"><strong>'. esc_html__( 'Jasmine Baker', 'blank-canvas-blocks' ) . '</strong></h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is no guarantee that 'almost-black' is going to be available in any child themes (or any theme once switched) I don't believe has-almost-black-color
(or any of the descriptive color values) should be used here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could use just the hex color but this is not a universal block pattern, is it? according to our slack conversation, child themes are going to unregister these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how all block patterns aren't "universal". If on theme A I use a block pattern, then change themes the blocks are still there but they they (potentially) look bad because classes that were expected are no longer there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that's the problem if we don't use hex codes or until we get semantic colors that are available to all themes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think for now we should use hex colors in all of the Blank Canvas patterns to combat this.
The only plugin I have is Gutenberg |
'title' => __( 'Gradient Links', 'blank-canvas-blocks' ), | ||
'categories' => array( 'link-in-bio' ), | ||
'content' => '<!-- wp:cover {"overlayColor":"background","minHeight":1090,"minHeightUnit":"px","align":"full"} --> | ||
<div class="wp-block-cover alignfull has-background-background-color has-background-dim" style="min-height:1090px"><div class="wp-block-cover__inner-container"><!-- wp:image {"align":"center","id":130,"width":96,"height":96,"sizeSlug":"large","linkDestination":"none","className":"is-style-rounded"} --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has-background-background-color
would be super if we had semantic colors define-able in our themes. But alas the "background color" is only available as a CSS variable since it's expressed in the "custom" block of theme.json. This color should probably be expressed another way.
'title' => __( 'Musician Links', 'blank-canvas-blocks' ), | ||
'categories' => array( 'link-in-bio' ), | ||
'content' => '<!-- wp:cover {"url":"' . esc_url( get_stylesheet_directory_uri() . '/assets/images/pattern-links-gradient.jpg' ) . '","id":181,"hasParallax":true,"dimRatio":0,"overlayColor":"primary","minHeight":100,"minHeightUnit":"vh","align":"full"} --> | ||
<div class="wp-block-cover alignfull has-primary-background-color has-parallax" style="background-image:url(' . esc_url( get_stylesheet_directory_uri() . '/assets/images/pattern-links-gradient.jpg' ) . ');min-height:100vh"><div class="wp-block-cover__inner-container"><!-- wp:spacer {"height":10} --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no has-primary-background-color
available to be used here.
… into add/bcb-block-patterns
…zation for the <em>s
I think this is ready for another test |
* Limit content width for things aligned left/right Co-authored-by: Jeff Ong <jeff.ong@automattic.com>
Pushed a minor change to alignment as it related to containers that aren't groups that this branch illuminated. |
Whoops — I posted some original notes over in #3415 (comment) before I realized this PR was here. This definitely improves upon that but I still have a bunch of notes:
|
Introduce spacing around P and H* elements using the custom.margin.vertical variable.
… into add/bcb-block-patterns
We made a number of changes to bring these patterns more in line with their designs:
My assumption is FSE handles this. |
@@ -16,6 +16,10 @@ img { | |||
max-width: 100%; | |||
} | |||
|
|||
hr { | |||
border: none; // Undo the wp-admin common.css: https://github.com/WordPress/WordPress/blob/fc6e4cbe3ef1dcd3a9977272d7ddcc413acdde0d/wp-admin/css/common.css#L865-L869 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR should undo what wp admin defines, but the browser defaults are not border: none;
so it will be different if/when that PR lands. add_theme_support( 'wp-block-styles' );
does provide some defaults for the separator, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That PR just landed, by the way
In general, if this is a 1:1 reproduction of Blank Canvas, we'll want the default post/page template to have no page title. We should definitely provide an alternate that does though. I see that in general, we need to add more templates, so this can totally be handled separately though. I'll put this on my list to re-test today. 👍 |
These changes look good, and match the existing patterns pretty well. 🙌 Only a few comments:
|
Because we aren't able to customize what I suggest we revert the emboldened changes, keeping them a tad bolder than desired but retaining the ability to embolden headers with rich text controls. |
This reverts commit d39b05f.
Do we need a Gutenberg issue for allowing global styles to specify a font weight for bold? Or is that tracked already somewhere? |
I don't believe so; I'm of the opinion that doing that in the font's CSS is appropriate. BCB is in a unique place where we're trying to avoid specifying things that aren't going to be controlled by Gutenberg (so subsequent child themes won't have to work to overcome it). As far as I know an issue doesn't exist for that. If that seems like a thing that should be user or theme configurable - outside of CSS - I wouldn't argue against it; just seems abstract enough a thing to expect to be in a theme's limited specific CSS. |
Regarding the button hover state, since the colors are applied with style properties there's no CSS solution. I don't believe the fix you reference is quite the same situation. I'm afraid that using that solution to style the buttons results in hover-less states. I would certainly be keen to address that problem in some way but I'm not sure how. It should probably have something to do with the button block directly though. |
We definitely fixed this for the normal version of Blank Canvas blocks — maybe it was in a followup PR actually? Or it could've been somewhere else. 🤔 In any case, we should make sure it's working the same way for Blank Canvas blocks, since I don't expect the hover states to be sorted out in Gutenberg for quite some time. The hover states were a blocking issue for launching the patterns back when we initially launched them, and I consider it a blocking issue for BCB too. I've opened #3538 to track it. |
I've also opened a Gutenberg issue for the bold font weight setting: WordPress/gutenberg#30297 |
Changes proposed in this Pull Request:
This PR adds block patterns to BCB. I have only tested the patterns that load on .org and I had to make adjustments due to the change in color naming conventions.
Related issue(s):
Closes #3415