-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 shape: make settings & style top-level keys #28110
Conversation
Size Change: +8 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
Let's make sure that published FSE themes are aligned with the final outcome of this proposal. |
@kjellr @carolinan @aristath @fklein-lu this PR and, potentially, the implementation of #27295 aim to update the structure of theme.json to accommodate new requisites. They're still in the early stages and things can change, but wanted to give you a heads-up. |
Thank you for the heads up @nosolosw! |
Thanks for the ping! I agree with @aristath — this seems like a good change conceptually. We'll need to update existing FSE themes, but that's ok. |
hey everyone, there's now an issue to centralize all these scattered conversations we've been having over the past months at #28163 so there's more clarity about the upcoming changes to theme.json. |
The changes seem logical to me, I have nothing additional to add. |
727c8b1
to
2c294d9
Compare
This still needs some work but I've made progress during the past few days. There're a few methods that need refactoring and for which the tests fail, but this should be ready to land early next week. |
An update for this PR: migrated This was the hard part. I'll focus next on |
Server code has been updated and this is expected to work fine in the front-end and post editor using this branch of TT1-blocks WordPress/theme-experiments#175 The site editor hasn't been adapted yet. I've also updated the issue description to add some testing instructions, in case someone wants to give this a try. |
This is now ready: it works on all the editors and the front-end. Unless there's something not working, I'm going to merge this one tomorrow to be able to continue working on follow-ups that also touch theme.json spec. I want them all shipped in a single Gutenberg version to avoid as much disruption to block-based themes as possible. We can iterate on this on new PRs if necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a big shift... but it's for the best. Tested the PR and works as advertised. Code looks good.
Thank you @nosolosw for working on this one! Looks good to merge 👍
I have followed the new testing steps without finding any issues. |
Thanks for taking the time to review and test! I'm actually going to hold off on merging this one until I figure when 9.9 is released. I'd like to merge together (some of) the changes described at #28163 in a single Gutenberg release so themes don't have to play catch-up. |
I looks like 9.9 was delayed a couple of days. I'm preparing a new PR based on this one that updates the other parts of theme.json we'd need to land the settings part in core #27506 The idea is that either all or none will be part of 9.9, as to make sure this all works together. |
OK, I have a PR for the next (and final) step ready locally. Going to merge this one and will share the link to the other. |
Here's the PR #28533 |
In accordance with WordPress/gutenberg#28110 the theme.json file has been updated to reflect the new expected shape.
In accordance with WordPress/gutenberg#28110 the theme.json file has been updated to reflect the new expected shape.
In accordance with WordPress/gutenberg#28110 the theme.json file has been updated to reflect the new expected shape.
In accordance with WordPress/gutenberg#28110 the theme.json file has been updated to reflect the new expected shape.
In accordance with WordPress/gutenberg#28110 the theme.json file has been updated to reflect the new expected shape.
Part of #28163
This PR reorganizes the structure of theme.json to make
settings
andstyles
top-level keys, while the contexts are sub-properties of them.Before this change:
After this change:
The rationale for this change is that the use cases for theme.json have grown beyond initially considered, and the vision is now being able to absorb a lot of things that themes declare at the moment via other means. Some examples are registering (and translate?) custom templates, declare theme metadata that is currently stored in the stylesheet, declare stylesheet paths, etc.
As things are ported/added to theme.json, a potential future theme.json could be like this:
Tasks:
How to test
Test instructions: