Repository navigation
Closed
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json
Description
This issue describes what it entails to land the "Global Styles" project in WordPress core. The project has two main functions: 1) allows themes to control the editor settings via theme.json, and 2) creates a mechanism that coordinates core, theme, and user styles.
- Control editor settings: to land as part of 5.7.
- Style mechanism: while it works without a UI (this is, without user styles), the plan is to land this part paired with the UI (sidebar at edit-site) to make sure the underlying APIs match the UI needs.
Tasks
- Consolidate shape of theme.json file (implement the parts of Updates to experimental-theme.json #28163 that are required)
- Settings as top-level key Update theme.json shape: make settings & style top-level keys #28110
- Split
globalinto*androot. Update theme.json: split global block selector into root and defaults #28533 - WORK IN PROGRESS ― i18n, land Global Styles: Use context when translating entries in theme.json #28246
- Questions:
- How to expand the behavior from the plugin: either implementing hooks (Add extensibility hooks to global styles infrastructure #27504 and proof of concept at Add hooks to modify theme.json structure #27722) or unregister what comes with core & use the plugin's code.
- We don't need to implement the full spec at Updates to experimental-theme.json #28163 (control design tools visibility) but we need to make sure that what we land in 5.7 in terms of visibility of controls is in line with the spec and can be upgraded in 5.8.
Affected files
- lib/editor-settings.php => land
gutenberg_get_common_block_editor_settingsso other editors don't need to repeat the same logic. - lib/experimental-theme.json => land the parts of it that affect settings.
- lib/class-wp-theme-json.php => land the parts of it that affect settings.
- lib/class-wp-theme-json-resolver.php => land the parts of it that affect settings. e.g.: do not expose user-origin methods as that something that only makes sense for styles at the moment.
- lib/global-styles.php => land
gutenberg_experimental_global_styles_settings(but only the settings logic, not the styles) - phpunit/class-wp-theme-json-test.php => land the tests related to settings and schema validation.
- phpunit/class-wp-theme-json-legacy-settings-test.php => to be paired with lib/global-styles.php
Reacted by Miguel Fonseca
Metadata
Metadata
Assignees
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json
Activity
oandregal commentedon Dec 14, 2020
I've removed the following two tasks from being blockers as they seem to be addressable after landing (if/when need it):
[-]Land Global Styles in WordPress core[/-][+]Global Styles in WordPress 5.7[/+]oandregal commentedon Jan 27, 2021
Removed #25612 from being a blocker. Can be added later.
oandregal commentedon Jan 27, 2021
I've confirmed with @swissspidy that the structure for
i18n-theme.jsonto be updated in #28110 together with #28246 is fine from a wp-cli perspective.oandregal commentedon Jan 27, 2021
#28533 is ready for review.
swissspidy commentedon Jan 27, 2021
pinging @schlessera and @ocean90 for review just in case
oandregal commentedon Jan 27, 2021
The latest can be reviewed on master: https://github.com/WordPress/gutenberg/blob/master/lib/experimental-i18n-theme.json I don't think I have to do any other modifications for the work in this issue, but happy to iterate and accomodate any other needs.
oandregal commentedon Feb 10, 2021
The main PRs this issue tracked are now shipped. While the plan was to port settings management to 5.7, we realized it was too soon to freeze theme.json format, see more details.
Going to close this one. Follow up #20331 for updates.