How to get default theme colours?
-
My block uses the theme’s color scheme for some of its defaults. In my application, it’s important to retrieve the colors through JS.
In the current version of WordPress, I can get the theme’s colors via:
wp.data.select( 'core/block-editor' ).getSettings().colors;
But in the latest version of Gutenberg, this no longer returns the theme’s colours. Instead it returns a new default WordPress colour scheme.
How can I get the theme’s palette instead?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to get default theme colours?’ is closed to new replies.