-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port global styles code to
lib/compat/wordpress-5.9
: css custom pro…
…perties (#37334)
- Loading branch information
Showing
3 changed files
with
21 additions
and
12 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
lib/compat/wordpress-5.9/global-styles-css-custom-properties.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Loads the CSS Custom Properties in use by Global Styles. | ||
* | ||
* @package Gutenberg | ||
*/ | ||
|
||
// This has been ported as part of default-filters.php. | ||
if ( ! function_exists( 'wp_enqueue_global_styles_css_custom_properties' ) ) { | ||
/** | ||
* Function to enqueue the CSS Custom Properties | ||
* coming from theme.json. | ||
*/ | ||
function wp_enqueue_global_styles_css_custom_properties() { | ||
wp_register_style( 'global-styles-css-custom-properties', false, array(), true, true ); | ||
wp_add_inline_style( 'global-styles-css-custom-properties', wp_get_global_stylesheet( array( 'variables' ) ) ); | ||
wp_enqueue_style( 'global-styles-css-custom-properties' ); | ||
} | ||
add_filter( 'enqueue_block_editor_assets', 'wp_enqueue_global_styles_css_custom_properties' ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters