-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Allow special user defined settings to theme.json #34755
Comments
Hey Michael, I've got two thoughts about this. You can already do it. It's just not "sanctioned" by WordPress. Any setting that is present in the file but is not valid according to the schema will be ignored. If a specific tool requires data stored in a certain format in The other thought is that I'm not sure it's a good idea to use this as a place to put "all the things". The file has a specific goal, which is helping themes. Things like perhaps generating the required "style.css" file from data stored in theme.json would be cool to have. Starting to pollute the file with things unrelated to themes can be confusing. |
@oandregal Hi André, |
Thanks for sharing, Michael. This is a topic that have popped up lately in a few PRs and issues. I feel it merits discussion in a centralized place. Created #35114 |
What problem does this address?
It would be nice to have a section in theme.json for settings, which are used for kind of 'special user defined' which is not parsed by Gutenberg/WordPress.
Using workflows and build tools (Webpack, Babel, Sass) which could import the 'special user defined' (and of course other settings to) for getting these settings needed to build and compile. With this, a theme developer may be able, to adjust all settings at a centralized file.
I have many settings, which I have to set several times - for sass, javascript and php. Why not use the theme.json as an centralized config file and parse or import it every where it is needed?
What is your proposed solution?
Adding a section to theme.json, which is not automatic parsed, modified or overwritten by WordPress/Gutenberg core. Make these section clear to all developers with a specific name, for example
site
,sitewide
or what ever.The text was updated successfully, but these errors were encountered: