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

References in theme.json don't work in site editor upon user changes #49745

Open
oandregal opened this issue Apr 12, 2023 · 1 comment
Open
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") 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

@oandregal
Copy link
Member

oandregal commented Apr 12, 2023

In theme.json styles can be referenced to an existing top-level style (docs).

The following example inverts the colors of the site title with respect to the top-level colors:

{
  "styles": {
    "color": {
      "background": "yellow",
      "text": "black"
    },
    "blocks": {
      "core/site-title": {
        "color": {
          "background": { "ref": "styles.color.text" },
          "text": {"ref": "styles.color.background" }
        }
      }
    }
  }
}

This works in the front and editors.

image

Bug: change the referenced value in the site editor

When the user makes changes to the referenced value, the value doesn't change accordingly:

Gravacao.de.ecra.a.partir.de.12-04-2023.09.36.55.webm

Moreover, upon saving and reloading the site editor, it stops working (it's properly rendered in the front):

image

@oandregal oandregal added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Apr 12, 2023
@oandregal
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") 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

1 participant