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 naming conflict for theme variables #36360

Closed
colorful-tones opened this issue Nov 9, 2021 · 1 comment
Closed

Color naming conflict for theme variables #36360

colorful-tones opened this issue Nov 9, 2021 · 1 comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended

Comments

@colorful-tones
Copy link
Member

Description

As I was running through testing of FSE Program Testing Call #11: Site Editing Safari I noticed an odd behavior with Global Styles custom colors.

I'm running WP 5.8.2-RC1-51987 using Beta Tester plugin, and using Gutenberg 11.9 RC3 with TT1 Blocks theme.

Here are the steps to recreate:

  1. Choose Appearance > Styles and choose Colors
  2. Under 'Palette' click on the '0 colors' to create a new custom palette
  3. Use + (plus) icon to add a new color
  4. Choose any color in the picker and type 'green' in the field. As soon as you complete 'green' the background of the page changes. There seems to be a CSS Custom Property name that is being overwritten.

While technically, this may make sense and may even be the intended outcome. However, from a user perceptive it is not ideal and the behavior is unexpected.

This likely would involve more mature APIs for colors, and still being discussed in: Default Colors, Theme Colors, and Custom Colors #29568. Also, it would be ideal to do some validation or checking to make sure color naming does not conflict.

Step-by-step reproduction instructions

(noted above)

Screenshots, screen recording, code snippet

Styles-color-naming-override.mp4

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.

Yes

@colorful-tones colorful-tones added [Feature] Full Site Editing Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Nov 9, 2021
@colorful-tones colorful-tones changed the title Color naming conflict for theme variables+ Color naming conflict for theme variables Nov 9, 2021
@colorful-tones colorful-tones added [Type] Bug An existing feature does not function as intended Backport to WP Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Nov 17, 2021
@oandregal
Copy link
Member

Thanks for reporting.

This should be resolved by #36674 which added a custom- prefix to any user-provided color to fix this use case, so there's no conflicts with theme or default colors.

@tellthemachines tellthemachines removed the Backport to WP Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Dec 20, 2021
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] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants