Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme's color palette no longer returned via Block Editor settings #32027

Closed
lukecarbis opened this issue May 20, 2021 · 5 comments
Closed

Theme's color palette no longer returned via Block Editor settings #32027

lukecarbis opened this issue May 20, 2021 · 5 comments
Assignees
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability

Comments

@lukecarbis
Copy link
Contributor

Description

wp.data.select( 'core/block-editor' ).getSettings().colors no longer returns theme colors.

Step-by-step reproduction instructions

  1. Disable Gutenberg
  2. Enable a theme with a colour palette (like Twenty Twenty-One)
  3. Open the Editor
  4. Run this in the console: wp.data.select( 'core/block-editor' ).getSettings().colors

At this point, note the colours – they're the colours that your theme has defined.

  1. Enable Gutenberg
  2. Open the Editor
  3. Run the same command in the console again

Notice that the colours returned are NOT the theme colours, but default Editor colours

Expected behaviour

The Block Editor "colors" setting would return the color palette defined by the theme.

Actual behaviour

The Block Editor "colors" setting returns an array of default WordPress colours.

WordPress information

  • WordPress version: 5.7.2
  • Gutenberg version: 10.6.1
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes

Device information

  • Device: MacBook Pro
  • Operating system: MacOS 11.3
  • Browser: Safari 14.1
@lukecarbis lukecarbis changed the title Theme's color palette no longer returning via wp.data Theme's color palette no longer returned via Block Editor settings May 20, 2021
@lukecarbis
Copy link
Contributor Author

Context: My block relies on access to the theme's default colour scheme. If this is an intentional breaking change, I'd love if someone could help with a way to get the theme's default colours.

@youknowriad youknowriad added the Backwards Compatibility Issues or PRs that impact backwards compatability label May 20, 2021
@oandregal oandregal mentioned this issue May 25, 2021
82 tasks
@youknowriad
Copy link
Contributor

@nosolosw Did we include a shim for these in the Core patch?

@oandregal
Copy link
Member

Yeah, in core and Gutenberg 10.7 the settings.color has the color palette.

Note, however, that since we landed #31669 the color palette includes both theme and core colors. Jorge has prepared a PR #32225 that will make the palette to only contain the theme colors. I've marked that PR as "fixing this issue".

@oandregal
Copy link
Member

There's an alternative to #32225 at #32358

@jorgefilipecosta jorgefilipecosta self-assigned this Jun 3, 2021
@oandregal
Copy link
Member

This has been fixed by #32358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants