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: adds a setting property that enables some other ones #36246
Conversation
Option 2 as it saves us a lot of typing and space in theme.json. |
Option 2 seems the most logical to me, and what @carolinan said too |
I would vote for Option 2. I'm thinking of it kind of in the same way we think of the global vs the block scope for settings. If the setting does not exist in the block level or on the global level it should use the default set by |
Yeah, option 2 makes sense to me as well. That way a theme author could easily opt into everything except one or two features if that's what they wanted to do. |
A few suggestions:
I think that second one seems most understandable to me. |
+1 option 2.
I prefer a more explicit naming like this ^ or "enableAllAppearanceControls". |
@@ -280,6 +280,14 @@ Each block can configure any of these settings separately, providing a more fine | |||
|
|||
Note, however, that not all settings are relevant for all blocks. The settings section provides an opt-in/opt-out mechanism for themes, but it's the block's responsibility to add support for the features that are relevant to it. For example, if a block doesn't implement the `dropCap` feature, a theme can't enable it for such a block through `theme.json`. | |||
|
|||
### Opt-in into appearance controls | |||
|
|||
There's one special setting property, `appareance`, which can be a boolean and its default value is true. When this is enabled, the following setting properties will be on by default: |
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.
Small typo, the key name is probably going to change the name anyways:
There's one special setting property, `appareance`, which can be a boolean and its default value is true. When this is enabled, the following setting properties will be on by default: | |
There's one special setting property, `appearance`, which can be a boolean and its default value is true. When this is enabled, the following setting properties will be on by default: |
I'm on the fence between
💯 agree that Option 2 seems ideal to me. Opt in to all, and then opt out of any few stragglers that theme author might want to.
I think the supported properties are great coverage: |
+1 for Option 2.
I'm not sure If we were going with Option 1, something like
My understanding is that use of margin support is going to be rather selective moving forward and we'll probably be leaning more on using All in all, this looks like it will be a great enhancement 👍 |
I see this is approved so swooping in to merge it in time for WP 5.9 beta 1 😀 |
This reverts commit ed922a1.
Sorry @oandregal, merging this caused legitimate PHP unit test failures on |
Second try at #36646 |
#36646 has been merged. |
Fixes #36187
As per the conversation in the issue linked, this PR adds a setting property whose function is to opt-in into a few others.
The result is that a theme.json like this one:
is the same as this other:
TODO
The name of the setting
At the moment, the setting's name is
appearance
as seen in the issue linked. I'd suggest changing it to a more obvious name, for example,allowOptIn
. It'd also free theappearance
key for our use in the future (it looks like a legit key that could be used).Confirm which settings need to be enabled
At the moment, they are:
What should happen with this theme.json?
Option 1, the new property enables everything and disregards the existing values for the properties it enables:
Option 2, the new property respects the false values of the properties it enables:
At the moment it works like option 1, which goes in line with the spirit of the original issue, as I see it: to let some themes to opt-in into any new settings Gutenberg adds.
I also see how 2 can be convenient.
Thoughts?