Changeset 62639 for trunk/tests/phpunit/tests/theme/wpThemeJson.php
- Timestamp:
- 07/06/2026 03:09:22 AM (3 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/theme/wpThemeJson.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r62607 r62639 7162 7162 7163 7163 /** 7164 * Tests that when a block with a custom feature selector (e.g. core/button's writingMode 7165 * uses '.wp-block-button' rather than the root '.wp-block-button .wp-block-button__link') 7166 * has pseudo-state styles, the feature selector CSS is scoped to the pseudo-state and not 7167 * output under the block's default-state selector. 7168 */ 7169 public function test_get_stylesheet_pseudo_selector_scopes_feature_selector_css() { 7170 $theme_json = new WP_Theme_JSON( 7171 array( 7172 'version' => WP_Theme_JSON::LATEST_SCHEMA, 7173 'styles' => array( 7174 'blocks' => array( 7175 'core/button' => array( 7176 ':hover' => array( 7177 'typography' => array( 7178 'writingMode' => 'vertical-rl', 7179 ), 7180 ), 7181 ), 7182 ), 7183 ), 7184 ), 7185 'default' 7186 ); 7187 7188 $css = $theme_json->get_stylesheet( array( 'styles' ), null, array( 'skip_root_layout_styles' => true ) ); 7189 7190 // writing-mode should be scoped to :hover, not the root block selector. 7191 $this->assertSame( ':root :where(.wp-block-button:hover){writing-mode: vertical-rl;}', $css ); 7192 } 7193 7194 /** 7164 7195 * Test that block pseudo selectors are processed correctly. 7165 7196 */
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)