Changeset 60892
- Timestamp:
- 10/02/2025 11:53:19 PM (6 weeks ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
src/wp-includes/class-wp-theme-json.php (modified) (4 diffs)
-
src/wp-includes/style-engine/class-wp-style-engine.php (modified) (1 diff)
-
tests/phpunit/tests/style-engine/styleEngine.php (modified) (2 diffs)
-
tests/phpunit/tests/theme/wpThemeJson.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r60809 r60892 127 127 * Updated the 'prevent_override' value for font size presets to use 'typography.defaultFontSizes' 128 128 * and spacing size presets to use `spacing.defaultSpacingSizes`. 129 * @since 6.9.0 Added `border.radiusSizes`. 129 130 * @var array 130 131 */ … … 206 207 'properties' => array( 'box-shadow' ), 207 208 ), 209 array( 210 'path' => array( 'border', 'radiusSizes' ), 211 'prevent_override' => false, 212 'use_default_names' => false, 213 'value_key' => 'size', 214 'css_vars' => '--wp--preset--border-radius--$slug', 215 'classes' => array(), 216 'properties' => array( 'border-radius' ), 217 ), 208 218 ); 209 219 … … 385 395 * @since 6.6.0 Added support for 'dimensions.aspectRatios', 'dimensions.defaultAspectRatios', 386 396 * 'typography.defaultFontSizes', and 'spacing.defaultSpacingSizes'. 397 * @since 6.9.0 Added support for `border.radiusSizes`. 387 398 * @var array 388 399 */ … … 395 406 ), 396 407 'border' => array( 397 'color' => null, 398 'radius' => null, 399 'style' => null, 400 'width' => null, 408 'color' => null, 409 'radius' => null, 410 'radiusSizes' => null, 411 'style' => null, 412 'width' => null, 401 413 ), 402 414 'color' => array( -
trunk/src/wp-includes/style-engine/class-wp-style-engine.php
r59442 r60892 143 143 ), 144 144 'path' => array( 'border', 'radius' ), 145 'css_vars' => array( 146 'border-radius' => '--wp--preset--border-radius--$slug', 147 ), 145 148 ), 146 149 'style' => array( -
trunk/tests/phpunit/tests/style-engine/styleEngine.php
r59199 r60892 31 31 * @ticket 61720 32 32 * @ticket 62189 33 * @ticket 63799 33 34 * 34 35 * @covers ::wp_style_engine_get_styles … … 172 173 ), 173 174 175 'inline_valid_border_radius_presets' => array( 176 'block_styles' => array( 177 'border' => array( 178 'radius' => array( 179 'topLeft' => 'var:preset|border-radius|large', 180 'topRight' => 'var:preset|border-radius|large', 181 'bottomLeft' => 'var:preset|border-radius|large', 182 'bottomRight' => 'var:preset|border-radius|large', 183 ), 184 ), 185 ), 186 'options' => null, 187 'expected_output' => array( 188 'css' => 'border-top-left-radius:var(--wp--preset--border-radius--large);border-top-right-radius:var(--wp--preset--border-radius--large);border-bottom-left-radius:var(--wp--preset--border-radius--large);border-bottom-right-radius:var(--wp--preset--border-radius--large);', 189 'declarations' => array( 190 'border-top-left-radius' => 'var(--wp--preset--border-radius--large)', 191 'border-top-right-radius' => 'var(--wp--preset--border-radius--large)', 192 'border-bottom-left-radius' => 'var(--wp--preset--border-radius--large)', 193 'border-bottom-right-radius' => 'var(--wp--preset--border-radius--large)', 194 ), 195 ), 196 ), 197 174 198 'inline_valid_dimensions_style' => array( 175 199 'block_styles' => array( -
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r60731 r60892 398 398 * @ticket 61630 399 399 * @ticket 61704 400 * @ticket 63799 400 401 */ 401 402 public function test_get_stylesheet() { … … 404 405 'version' => WP_Theme_JSON::LATEST_SCHEMA, 405 406 'settings' => array( 407 'border' => array( 408 'radiusSizes' => array( 409 array( 410 'name' => 'Small', 411 'slug' => 'small', 412 'size' => '2px', 413 ), 414 array( 415 'name' => 'Medium', 416 'slug' => 'medium', 417 'size' => '4px', 418 ), 419 ), 420 ), 406 421 'color' => array( 407 422 'text' => 'value', … … 478 493 'blocks' => array( 479 494 'core/cover' => array( 495 'border' => array( 496 'radius' => 'var:preset|border-radius|small', 497 ), 480 498 'dimensions' => array( 481 499 'aspectRatio' => '16/9', … … 567 585 ); 568 586 569 $variables = ':root{--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--font-size--small: 14px;--wp--preset--font-size--big: 41px;--wp--preset--font-family--arial: Arial, serif; }.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;}';570 $styles = ':where(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; }:where(.is-layout-flex){gap: 0.5em;}:where(.is-layout-grid){gap: 0.5em;}.is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}.is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}.is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}.is-layout-constrained > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}.is-layout-constrained > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}.is-layout-constrained > .aligncenter{margin-left: auto !important;margin-right: auto !important;}.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)){margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}.is-layout-flex{flex-wrap: wrap;align-items: center;}.is-layout-flex > :is(*, div){margin: 0;}body .is-layout-grid{display: grid;}.is-layout-grid > :is(*, div){margin: 0;}body{color: var(--wp--preset--color--grey);}a:where(:not(.wp-element-button)){background-color: #333;color: #111;}:root :where(.wp-element-button, .wp-block-button__link){box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.66);}:root :where(.wp-block-cover){min-height: unset;aspect-ratio: 16/9; }:root :where(.wp-block-group){background: var(--wp--preset--gradient--custom-gradient);border-radius: 10px;min-height: 50vh;padding: 24px;}:root :where(.wp-block-group a:where(:not(.wp-element-button))){color: #111;}:root :where(.wp-block-heading){color: #123456;}:root :where(.wp-block-heading a:where(:not(.wp-element-button))){background-color: #333;color: #111;font-size: 60px;}:root :where(.wp-block-media-text){text-align: center;}:root :where(.wp-block-post-date){color: #123456;}:root :where(.wp-block-post-date a:where(:not(.wp-element-button))){background-color: #777;color: #555;}:root :where(.wp-block-post-excerpt){column-count: 2;}:root :where(.wp-block-image){margin-bottom: 30px;}:root :where(.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder){border-top-left-radius: 10px;border-bottom-right-radius: 1em;}:root :where(.wp-block-image img, .wp-block-image .components-placeholder){filter: var(--wp--preset--duotone--custom-duotone);}';587 $variables = ':root{--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--font-size--small: 14px;--wp--preset--font-size--big: 41px;--wp--preset--font-family--arial: Arial, serif;--wp--preset--border-radius--small: 2px;--wp--preset--border-radius--medium: 4px;}.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;}'; 588 $styles = ':where(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; }:where(.is-layout-flex){gap: 0.5em;}:where(.is-layout-grid){gap: 0.5em;}.is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}.is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}.is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}.is-layout-constrained > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}.is-layout-constrained > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}.is-layout-constrained > .aligncenter{margin-left: auto !important;margin-right: auto !important;}.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)){margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}.is-layout-flex{flex-wrap: wrap;align-items: center;}.is-layout-flex > :is(*, div){margin: 0;}body .is-layout-grid{display: grid;}.is-layout-grid > :is(*, div){margin: 0;}body{color: var(--wp--preset--color--grey);}a:where(:not(.wp-element-button)){background-color: #333;color: #111;}:root :where(.wp-element-button, .wp-block-button__link){box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.66);}:root :where(.wp-block-cover){min-height: unset;aspect-ratio: 16/9;border-radius: var(--wp--preset--border-radius--small);}:root :where(.wp-block-group){background: var(--wp--preset--gradient--custom-gradient);border-radius: 10px;min-height: 50vh;padding: 24px;}:root :where(.wp-block-group a:where(:not(.wp-element-button))){color: #111;}:root :where(.wp-block-heading){color: #123456;}:root :where(.wp-block-heading a:where(:not(.wp-element-button))){background-color: #333;color: #111;font-size: 60px;}:root :where(.wp-block-media-text){text-align: center;}:root :where(.wp-block-post-date){color: #123456;}:root :where(.wp-block-post-date a:where(:not(.wp-element-button))){background-color: #777;color: #555;}:root :where(.wp-block-post-excerpt){column-count: 2;}:root :where(.wp-block-image){margin-bottom: 30px;}:root :where(.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder){border-top-left-radius: 10px;border-bottom-right-radius: 1em;}:root :where(.wp-block-image img, .wp-block-image .components-placeholder){filter: var(--wp--preset--duotone--custom-duotone);}'; 571 589 $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-size{font-size: var(--wp--preset--font-size--small) !important;}.has-big-font-size{font-size: var(--wp--preset--font-size--big) !important;}.has-arial-font-family{font-family: var(--wp--preset--font-family--arial) !important;}'; 572 590 $all = $variables . $styles . $presets;
Note: See TracChangeset
for help on using the changeset viewer.