Issues with getEditorSettings to access theme default color or gradient palette #59171
Labels
Needs Technical Feedback
Needs testing from a developer perspective.
[Type] Bug
An existing feature does not function as intended
Description
I'm trying to read the theme color palette in a custom block using the editorStore.
If there are no custom user colors, it returns the theme's default colors array (which is the expected behavior).
However, if the user defines a custom color, it only returns the user's custom color without including all the theme defaults.
Is this a bug, or is there another way to access this data?
In the
with-colors.js
component on Gutenberg there is a useSettings function, that appears to be private that read from:Step-by-step reproduction instructions
import { store as editorStore } from '@wordpress/editor';
const { getEditorSettings } = select(editorStore);
const colors = getEditorSettings().colors;
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
The text was updated successfully, but these errors were encountered: