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

Color Randomizer – does not work with no colors in theme.json #50150

Closed
colorful-tones opened this issue Apr 27, 2023 · 0 comments · Fixed by #51539
Closed

Color Randomizer – does not work with no colors in theme.json #50150

colorful-tones opened this issue Apr 27, 2023 · 0 comments · Fixed by #51539
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Experimental Experimental feature or API.

Comments

@colorful-tones
Copy link
Member

colorful-tones commented Apr 27, 2023

Description

When using the Create Block Theme plugin to generate a blank theme, no colors are available in the blank theme's theme.json. Therefore, when you go to use the Color Randomizer, it throws an error in the console:

react-dom.min.js?ver=18:1 Uncaught TypeError: Cannot read properties of undefined (reading 'map')

Step-by-step reproduction instructions

  1. Activate Gutenberg and Create Block Theme plugin
  2. Be sure to go to Gutenberg > Experiments and activate the Color randomizer experiment.
  3. Visit Appearance > Create Block Theme (WP Admin)
  4. Choose 'Create a blank theme' and Save
  5. Visit Appearance > Themes, and activate the newly created blank theme
  6. Visit Global Styles > Colors in Appearance > Editor and hit the 'Randomize colors` (open browser console for error)

Note: after creating a blank theme you can deactivate the Create Block Theme plugin and the issue still persists.

Screenshot 2023-04-27 at 4 13 00 PM

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.2
Gutenberg 15.6.2
Create Block Theme plugin 1.8.2

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@colorful-tones colorful-tones added [Type] Experimental Experimental feature or API. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Apr 27, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jun 15, 2023
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Experimental Experimental feature or API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants