Closed SchneiderSam closed 1 year ago
Thats not related to GB. You need to load your customiser styles in the editor. As WP doesn't do it for you.
this snippet:
add_filter( 'block_editor_settings_all', function( $editor_settings ) {
$css = wp_get_custom_css_post()->post_content;
$editor_settings['styles'][] = array( 'css' => $css );
return $editor_settings;
} );
Description
I've encountered an issue with GenerateBlocks where CSS variable values, specifically
var(--space-xl)
, don't seem to reflect accurately in the WordPress block editor for new components.Steps to reproduce
var(--space-xl)
as the value for spacing.Expected behavior
When I enter a
var()
value, it should be displayed consistently in both the frontend and the editor, indicating that the spacing has been defined.Actual behavior
While the frontend displays the spacing correctly, in the block editor, it appears as if no spacing has been defined.
References:
https://github.com/tomusborne/generateblocks/assets/9355398/db6f7dc4-9c57-47cd-a317-add3974b2b01