Twenty Twenty-Two: Import the latest changes from GitHub.

Updates `theme.json` to use v2 shape, adds styles to search and file block as well as generic text decoration. Fixes a bug in the layout of a query block pattern.

This is a follow-up to [52081]. These changes are ongoing and development continues on GitHub. To view all of the changes included in this commit, see GitHub: 99db6063be...a11fb4932a

Props desrosj, kjellr, poena.
See #54318.

Built from https://develop.svn.wordpress.org/trunk@52164


git-svn-id: http://core.svn.wordpress.org/trunk@51756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
jffng 2021-11-15 19:15:04 +00:00
parent 9ac09f5a67
commit 9043992e3b
5 changed files with 74 additions and 18 deletions

View File

@ -13,10 +13,7 @@
if ( ! function_exists( 'twentytwentytwo_support' ) ) :
/**
* Add support for core block visual styles.
* Styles load in both the editor and the front end.
*
* @link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#default-block-styles
* Sets up theme defaults and registers support for various WordPress features.
*
* @since Twenty Twenty-Two 1.0
*
@ -24,8 +21,12 @@ if ( ! function_exists( 'twentytwentytwo_support' ) ) :
*/
function twentytwentytwo_support() {
// Add support for block styles.
add_theme_support( 'wp-block-styles' );
// Enqueue editor styles.
add_editor_style( 'style.css' );
}
endif;

View File

@ -10,11 +10,15 @@ return array(
<div class="wp-block-query"><!-- wp:post-template -->
<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"200px"} /-->
<!-- wp:group {"layout":{"type":"flex","justifyContent":"space-between"}} -->
<div class="wp-block-group"><!-- wp:post-title {"isLink":true,"style":{"typography":{"fontFamily":"var:preset|font-family|system-font","fontStyle":"normal","fontWeight":"400"}},"fontSize":"small"} /-->
<!-- wp:columns {"isStackedOnMobile":false,"style":{"spacing":{"blockGap":"0.5rem"}}} -->
<div class="wp-block-columns is-not-stacked-on-mobile"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:post-title {"isLink":true,"style":{"typography":{"fontStyle":"normal","fontWeight":"400"},"spacing":{"margin":{"top":"0.2em"}}},"fontSize":"small","fontFamily":"system-font"} /--></div>
<!-- /wp:column -->
<!-- wp:post-date {"format":"m.d.y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div>
<!-- /wp:group -->
<!-- wp:column {"width":"4em"} -->
<div class="wp-block-column" style="flex-basis:4em"><!-- wp:post-date {"textAlign":"right","format":"m.d.y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
<!-- /wp:post-template -->
<!-- wp:separator {"className":"is-style-wide"} -->

View File

@ -16,3 +16,55 @@ Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, feature
Twenty Twenty-Two WordPress Theme, (C) 2021 WordPress.org
Twenty Twenty-Two is distributed under the terms of the GNU GPL.
*/
/*
* Font smoothing.
* This is a niche setting that will not be available via Global Styles.
* https://github.com/WordPress/gutenberg/issues/35934
*/
body {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
/*
* Text link styles.
* Necessary until the following issue is resolved in Gutenberg:
* https://github.com/WordPress/gutenberg/issues/27075
*/
a {
text-decoration-thickness: 1px;
text-underline-offset: 0.25ch;
}
a:hover,
a:focus {
text-decoration-style: dashed;
}
a:active {
text-decoration: none;
}
/*
* Search and File Block button styles.
* Necessary until the following issues are resolved in Gutenberg:
* https://github.com/WordPress/gutenberg/issues/36444
* https://github.com/WordPress/gutenberg/issues/27760
*/
.wp-block-search__button,
.wp-block-file .wp-block-file__button {
background-color: var(--wp--preset--color--primary);
border-radius: 0;
border: none;
color: var(--wp--preset--color--background);
font-size: var(--wp--preset--typography--font-size--normal);
padding: calc(.667em + 2px) calc(1.333em + 2px);
}
.wp-block-file a.wp-block-file__button:hover {
opacity: 1;
}

View File

@ -1,6 +1,5 @@
{
"$schema": "https://json.schemastore.org/theme-v1.json",
"version": 1,
"version": 2,
"customTemplates": [
{
"name": "blank",
@ -158,8 +157,8 @@
},
"spacing": {
"blockGap": true,
"customMargin": true,
"customPadding": true,
"margin": true,
"padding": true,
"units": [
"%",
"px",
@ -171,7 +170,7 @@
},
"typography": {
"dropCap": false,
"customLineHeight": true,
"lineHeight": true,
"fontFamilies": [
{
"fontFamily": "-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif",
@ -217,10 +216,10 @@
"wideSize": "1000px"
},
"border": {
"customColor": true,
"customRadius": true,
"customStyle": true,
"customWidth": true
"color": true,
"radius": true,
"style": true,
"width": true
}
},
"styles": {

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-52163';
$wp_version = '5.9-alpha-52164';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.