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

Update theme.json schema to mark text as an invalid variable name #53153

Open
hanneslsm opened this issue Jul 30, 2023 · 7 comments
Open

Update theme.json schema to mark text as an invalid variable name #53153

hanneslsm opened this issue Jul 30, 2023 · 7 comments
Labels
[Package] Style Engine /packages/style-engine [Type] Bug An existing feature does not function as intended

Comments

@hanneslsm
Copy link

hanneslsm commented Jul 30, 2023

When I am adding the following color to my theme.json it overwrites all paragraphs where a custom text color is set.
This is just a coincidence that it generates the .has-text-color which is also used as a class, right?

  "settings": {
    "color": {
         "palette": [
                {
                  "color": "red",
                  "name": "Text",
                  "slug": "text"
                }
…
@hanneslsm
Copy link
Author

Okay, I was able to reproduce this also with TT3.
My assumption from above was right.

image

Who from the documentation team could be pinged to add to the handbook that a variable with the slug "text" cannot be used?

@hanneslsm
Copy link
Author

hanneslsm commented Jul 30, 2023

Don't know if it's possible, but maybe it could also be added to the Schema as an invalid variable?

@jordesign jordesign added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. [Package] Style Engine /packages/style-engine labels Jul 31, 2023
@annezazu annezazu removed the Needs Testing Needs further testing to be confirmed. label Jul 31, 2023
@annezazu
Copy link
Contributor

Do you mind opening an issue here for the docs team? https://github.com/WordPress/Documentation-Issue-Tracker/issues Someone can follow up there :)

@annezazu
Copy link
Contributor

I'm going to close this out for now though but let me know if I'm missing something or it needs to be re-opened.

@hanneslsm
Copy link
Author

Sure, Iw ill open an issue for the docs team.
However, if the Schema could also be changed, that would be great - so maybe reopening the issue for that? :)

@annezazu
Copy link
Contributor

@ryanwelcher is this something you could help with since you implemented the schema from what I can remember?

@annezazu annezazu reopened this Jul 31, 2023
@annezazu annezazu changed the title Color variable overwrites all custom text colors Update theme.json schema to mark text as an invalid variable name Jul 31, 2023
@t-hamano
Copy link
Contributor

I think two approaches are valid for this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Style Engine /packages/style-engine [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants