Changeset 55985
- Timestamp:
- 06/22/2023 08:16:05 AM (22 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/typography.php
r55947 r55985 11 11 * 12 12 * @since 5.6.0 13 * @since 6.3.0 Added support for text-columns. 13 14 * @access private 14 15 * … … 31 32 $has_letter_spacing_support = _wp_array_get( $typography_supports, array( '__experimentalLetterSpacing' ), false ); 32 33 $has_line_height_support = _wp_array_get( $typography_supports, array( 'lineHeight' ), false ); 34 $has_text_columns_support = _wp_array_get( $typography_supports, array( 'textColumns' ), false ); 33 35 $has_text_decoration_support = _wp_array_get( $typography_supports, array( '__experimentalTextDecoration' ), false ); 34 36 $has_text_transform_support = _wp_array_get( $typography_supports, array( '__experimentalTextTransform' ), false ); … … 40 42 || $has_letter_spacing_support 41 43 || $has_line_height_support 44 || $has_text_columns_support 42 45 || $has_text_decoration_support 43 46 || $has_text_transform_support; … … 73 76 * @since 5.6.0 74 77 * @since 6.1.0 Used the style engine to generate CSS and classnames. 78 * @since 6.3.0 Added support for text-columns. 75 79 * @access private 76 80 * … … 99 103 $has_letter_spacing_support = _wp_array_get( $typography_supports, array( '__experimentalLetterSpacing' ), false ); 100 104 $has_line_height_support = _wp_array_get( $typography_supports, array( 'lineHeight' ), false ); 105 $has_text_columns_support = _wp_array_get( $typography_supports, array( 'textColumns' ), false ); 101 106 $has_text_decoration_support = _wp_array_get( $typography_supports, array( '__experimentalTextDecoration' ), false ); 102 107 $has_text_transform_support = _wp_array_get( $typography_supports, array( '__experimentalTextTransform' ), false ); … … 108 113 $should_skip_font_weight = wp_should_skip_block_supports_serialization( $block_type, 'typography', 'fontWeight' ); 109 114 $should_skip_line_height = wp_should_skip_block_supports_serialization( $block_type, 'typography', 'lineHeight' ); 115 $should_skip_text_columns = wp_should_skip_block_supports_serialization( $block_type, 'typography', 'textColumns' ); 110 116 $should_skip_text_decoration = wp_should_skip_block_supports_serialization( $block_type, 'typography', 'textDecoration' ); 111 117 $should_skip_text_transform = wp_should_skip_block_supports_serialization( $block_type, 'typography', 'textTransform' ); … … 163 169 } 164 170 171 if ( $has_text_columns_support && ! $should_skip_text_columns && isset( $block_attributes['style']['typography']['textColumns'] ) ) { 172 $typography_block_styles['textColumns'] = _wp_array_get( $block_attributes, array( 'style', 'typography', 'textColumns' ), null ); 173 } 174 165 175 if ( 166 176 $has_text_decoration_support && -
trunk/src/wp-includes/class-wp-theme-json.php
r55975 r55985 202 202 * removed the `--wp--style--block-gap` property. 203 203 * @since 6.2.0 Added `outline-*`, and `min-height` properties. 204 * @since 6.3.0 Added `column-count` property. 204 205 * 205 206 * @var array … … 229 230 'border-left-style' => array( 'border', 'left', 'style' ), 230 231 'color' => array( 'color', 'text' ), 232 'column-count' => array( 'typography', 'textColumns' ), 231 233 'font-family' => array( 'typography', 'fontFamily' ), 232 234 'font-size' => array( 'typography', 'fontSize' ), … … 335 337 * @since 6.2.0 Added `dimensions.minHeight`, 'shadow.presets', 'shadow.defaultPresets', 336 338 * `position.fixed` and `position.sticky`. 339 * @since 6.3.0 Added support for `typography.textColumns`. 340 * 337 341 * @var array 338 342 */ … … 396 400 'letterSpacing' => null, 397 401 'lineHeight' => null, 402 'textColumns' => null, 398 403 'textDecoration' => null, 399 404 'textTransform' => null, … … 412 417 * updated `blockGap` to be allowed at any level. 413 418 * @since 6.2.0 Added `outline`, and `minHeight` properties. 419 * @since 6.3.0 Added support for `typography.textColumns`. 414 420 * 415 421 * @var array … … 456 462 'letterSpacing' => null, 457 463 'lineHeight' => null, 464 'textColumns' => null, 458 465 'textDecoration' => null, 459 466 'textTransform' => null, -
trunk/src/wp-includes/style-engine/class-wp-style-engine.php
r55820 r55985 22 22 * @access private 23 23 * @since 6.1.0 24 * @since 6.3.0 Added support for text-columns. 24 25 */ 25 26 #[AllowDynamicProperties] … … 218 219 'path' => array( 'typography', 'lineHeight' ), 219 220 ), 221 'textColumns' => array( 222 'property_keys' => array( 223 'default' => 'column-count', 224 ), 225 'path' => array( 'typography', 'textColumns' ), 226 ), 220 227 'textDecoration' => array( 221 228 'property_keys' => array( -
trunk/tests/phpunit/tests/style-engine/styleEngine.php
r55175 r55985 26 26 * 27 27 * @ticket 56467 28 * @ticket 58549 28 29 * 29 30 * @covers ::wp_style_engine_get_styles … … 190 191 'fontWeight' => '800', 191 192 'lineHeight' => '1.3', 193 'textColumns' => '2', 192 194 'textDecoration' => 'underline', 193 195 'textTransform' => 'uppercase', … … 197 199 'options' => null, 198 200 'expected_output' => array( 199 'css' => 'font-size:clamp(2em, 2vw, 4em);font-family:Roboto,Oxygen-Sans,Ubuntu,sans-serif;font-style:italic;font-weight:800;line-height:1.3; text-decoration:underline;text-transform:uppercase;letter-spacing:2;',201 'css' => 'font-size:clamp(2em, 2vw, 4em);font-family:Roboto,Oxygen-Sans,Ubuntu,sans-serif;font-style:italic;font-weight:800;line-height:1.3;column-count:2;text-decoration:underline;text-transform:uppercase;letter-spacing:2;', 200 202 'declarations' => array( 201 203 'font-size' => 'clamp(2em, 2vw, 4em)', … … 204 206 'font-weight' => '800', 205 207 'line-height' => '1.3', 208 'column-count' => '2', 206 209 'text-decoration' => 'underline', 207 210 'text-transform' => 'uppercase', -
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r55959 r55985 477 477 * @ticket 54336 478 478 * @ticket 56611 479 * @ticket 58549 479 480 */ 480 481 public function test_get_stylesheet() { … … 549 550 ), 550 551 'blocks' => array( 551 'core/group' => array(552 'core/group' => array( 552 553 'color' => array( 553 554 'gradient' => 'var:preset|gradient|custom-gradient', … … 567 568 ), 568 569 ), 569 'core/heading' => array(570 'core/heading' => array( 570 571 'color' => array( 571 572 'text' => '#123456', … … 583 584 ), 584 585 ), 585 'core/post-date' => array(586 'core/post-date' => array( 586 587 'color' => array( 587 588 'text' => '#123456', … … 596 597 ), 597 598 ), 598 'core/image' => array( 599 'core/post-excerpt' => array( 600 'typography' => array( 601 'textColumns' => 2, 602 ), 603 ), 604 'core/image' => array( 599 605 'border' => array( 600 606 'radius' => array( … … 622 628 623 629 $variables = "body{--wp--preset--color--grey: grey;--wp--preset--gradient--custom-gradient: linear-gradient(135deg,rgba(0,0,0) 0%,rgb(0,0,0) 100%);--wp--preset--duotone--custom-duotone: url('#wp-duotone-custom-duotone');--wp--preset--font-family--small: 14px;--wp--preset--font-family--big: 41px;}.wp-block-group{--wp--custom--base-font: 16;--wp--custom--line-height--small: 1.2;--wp--custom--line-height--medium: 1.4;--wp--custom--line-height--large: 1.8;}"; 624 $styles = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }body{color: var(--wp--preset--color--grey);}a:where(:not(.wp-element-button)){background-color: #333;color: #111;}.wp-element-button, .wp-block-button__link{box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.66);}.wp-block-group{background: var(--wp--preset--gradient--custom-gradient);border-radius: 10px;padding: 24px;}.wp-block-group a:where(:not(.wp-element-button)){color: #111;}.wp-block-heading{color: #123456;}.wp-block-heading a:where(:not(.wp-element-button)){background-color: #333;color: #111;font-size: 60px;}.wp-block-post-date{color: #123456;}.wp-block-post-date a:where(:not(.wp-element-button)){background-color: #777;color: #555;}.wp-block- image{margin-bottom: 30px;}.wp-block-image img, .wp-block-image .components-placeholder{filter: var(--wp--preset--duotone--custom-duotone);}.wp-block-image img, .wp-block-image .wp-block-image__crop-area{border-top-left-radius: 10px;border-bottom-right-radius: 1em;}';630 $styles = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }body{color: var(--wp--preset--color--grey);}a:where(:not(.wp-element-button)){background-color: #333;color: #111;}.wp-element-button, .wp-block-button__link{box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.66);}.wp-block-group{background: var(--wp--preset--gradient--custom-gradient);border-radius: 10px;padding: 24px;}.wp-block-group a:where(:not(.wp-element-button)){color: #111;}.wp-block-heading{color: #123456;}.wp-block-heading a:where(:not(.wp-element-button)){background-color: #333;color: #111;font-size: 60px;}.wp-block-post-date{color: #123456;}.wp-block-post-date a:where(:not(.wp-element-button)){background-color: #777;color: #555;}.wp-block-post-excerpt{column-count: 2;}.wp-block-image{margin-bottom: 30px;}.wp-block-image img, .wp-block-image .components-placeholder{filter: var(--wp--preset--duotone--custom-duotone);}.wp-block-image img, .wp-block-image .wp-block-image__crop-area{border-top-left-radius: 10px;border-bottom-right-radius: 1em;}'; 625 631 $presets = '.has-grey-color{color: var(--wp--preset--color--grey) !important;}.has-grey-background-color{background-color: var(--wp--preset--color--grey) !important;}.has-grey-border-color{border-color: var(--wp--preset--color--grey) !important;}.has-custom-gradient-gradient-background{background: var(--wp--preset--gradient--custom-gradient) !important;}.has-small-font-family{font-family: var(--wp--preset--font-family--small) !important;}.has-big-font-family{font-family: var(--wp--preset--font-family--big) !important;}'; 626 632 $all = $variables . $styles . $presets;
Note: See TracChangeset
for help on using the changeset viewer.