-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add fallback layout styles for Post Template #4639
Add fallback layout styles for Post Template #4639
Conversation
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 wasn't sure how to test this individual patch, but I've applied the patch locally and can't see any regressions with new and existing post template blocks for block and classic themes (I used grid view in query blocks).
The changes match those in the Gutenberg PR.
Do these unit tests need to be ported over? Or will they be taken care of in #4625?
@@ -1053,11 +1053,13 @@ public function get_stylesheet( $types = array( 'variables', 'styles', 'presets' | |||
} | |||
$stylesheet .= $this->get_block_classes( $style_nodes ); | |||
} elseif ( in_array( 'base-layout-styles', $types, true ) ) { | |||
$root_selector = static::ROOT_BLOCK_SELECTOR; | |||
$columns_selector = '.wp-block-columns'; | |||
$root_selector = static::ROOT_BLOCK_SELECTOR; |
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.
Would we need a @since
annotation in the function PHPDoc block? E.g.,
* @since 6.3.0 Add fallback layout styles for Post Template when block gap support isn't available.
??
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.
Ah good point, yes, I'll add that in!
I think I need to commit #4625 first and then rebase this one, because the tests are still passing without updating the string. |
b18e747
to
7d51eaa
Compare
Hmmm, looks like the fallback styles are not being output yet, because the packages haven't been updated, so Post Template block still doesn't have spacing support, so this check fails 😞 This is a small PR so I guess it can wait until the packages are updated, and once they are I can update the unit test string. |
That approach makes sense to me as well! |
7d51eaa
to
e6c4810
Compare
Trac ticket: https://core.trac.wordpress.org/ticket/58570
Adds the Post Template fallback styles for classic themes from WordPress/gutenberg#49050, following the same logic already used for the Columns block.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.