-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Creating a new color in multibyte character, the style in editor will be broken. #39210
Comments
Actually, this bug comes from the CSS parser, here allowed characters for the CSS properties are Parser prop matcher:
I think the easiest solution will be allowing only these |
This issue may also be related to #49711. |
The root cause of this problem is probably the use of the This function is a Here are some of the codes that are causing the problem. In custom palettes, multibyte characters are deleted when palette labels are changed:
Multibyte characters are removed when generating CSS variables with gutenberg/packages/block-editor/src/components/global-styles/use-global-styles-output.js Line 81 in ab97d28
I hesitate to take the approach of limiting input characters. Users will want to name their custom palettes based on their language. Ideally, I think it should generate a unique and appropriate slug for whatever characters are entered. |
Currently custom palettes do not generate a slug from the label, but generate a unified slug called This issue is no longer occurring, so I'm closing this issue. However, if we add a palette via theme.json, we can define any slug and will experience similar issues. This issue is tracked as #49711. |
Description
When creating a new color in Editor>Style>Pallet>Custom, the editor style is broken if a color name is created using multibyte characters such as Japanese or Emoji.
Especially when the language setting is Japanese, the default name is "color1", which is broken as it is.
Japanese default value should be "color1" to disable input of multibyte characters or not break when typed.
Also, the css custom properties created in theme.json (--wp--preset--xxxx,--wp--custom-xxxx) are not output in the above action, which seems to break the style.
Step-by-step reproduction instructions
Try also if you set the language to Japanese.
Screenshots, screen recording, code snippet
editor-style-bug.mov
Environment info
WordPress 5.9.1
Gutenberg 12.6.1
Chrome 98.0.4758.109
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
The text was updated successfully, but these errors were encountered: