I'm trying to use colors selected in the customizer to change the theme colors in the Gutenberg editor. I'm using metabox to set the theme colors. I'm missing something.
This is essentially what I'm trying to do. It doesn't work. Any ideas?
$primary = rwmb_meta( 'primary_color', [ 'object_type' => 'setting' ], 'site_settings' );
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Primary', 'themeLangDomain' ),
'slug' => 'primary',
'color' => '$primary',
),
source https://stackoverflow.com/questions/76075736/using-color-variables-in-wp-gutenberg-color-palette
No comments:
Post a Comment