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

🚧 Theme JSON: resolve ref paths in get_raw_data() #49737

Closed
wants to merge 1 commit into from

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Apr 12, 2023

🚧 Very naive and rough approach for #49715

What?

Testing out how we can resolve ref paths for every style value in the theme json tree when calling get_raw_data()

TODO:

  • Tests
  • Should we make ref resolution optional? After all the method is called get_raw_data, emphasis on "RAW"

Why?

See: #49715

How?

Testing Instructions

See: #49715 for now

… theme json tree when calling get_raw_data()
@oandregal
Copy link
Member

It doesn't look like we can use get_raw_data, given it is part of the merge process: each origin will be resolved only taking into account its own data. This can be reproduced with the instructions at this issue (make the site title invert the global colors: uses global background as text and global text as background).

No user changes With user changes
Captura de ecrã de 2023-04-12 11-37-38 image

Note how the site title retains the inverted colors from the theme (black & white) instead of using the new background defined by the user

@oandregal
Copy link
Member

oandregal commented Apr 12, 2023

More braindump. In addition to the merge method, there are a few other places where we use this:

All these places but duotone need the references unresolved, as they are used at some point via the REST endpoint to send data to the site editor.

@oandregal
Copy link
Member

I'm thinking we should close this exploration and focus on different next steps.

Thanks for taking the time to explore, Ramon!

@ramonjd
Copy link
Member Author

ramonjd commented Apr 12, 2023

Thanks for investigating this one @oandregal 🙇

@ramonjd ramonjd closed this Apr 12, 2023
@ramonjd ramonjd deleted the update/resolve-style-refs-for-get-raw-data branch April 12, 2023 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants