-
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
Controlling design tools visibility #27295
Comments
I think the gist of what we want to streamline is that, for every style property, we want theme authors to be able to control:
Some ideasTaking on what Riad and Jorge discussed over here and adding my own ideas. Something along the lines of this could work:
A potential schema for the settings with all of them, so we have some zoomed out perspective: {
"color": {
"color": "all",
"colorCustom": "block",
"colorPresets": [ "..." ],
"gradient": "all",
"gradientCustom": "block",
"gradientPresets": [ "..." ],
"link": "global"
},
"spacing": {
"padding": "all",
"units": "block",
"unitsPresets": [ "px", "em", "rem" ]
},
"typography": {
"dropCap": "block",
"fontFamily": "global",
"fontFamilyPresets": [ "..." ],
"fontSize": "all",
"fontSizeCustom": "block",
"fontSizePresets": [ "..." ],
"fontStyle": "global",
"fontStylePresets": [ "..." ],
"fontWeight": "global",
"fontWeightPresets": [ "..." ],
"lineHeight": "none",
"textDecoration": "global",
"textDecorationPresets": [ "..." ],
"textTransform": "global",
"textTransformPresets": [ "..." ],
}
} ExampleFixes all use cases in the issue description: {
"*": {
"settings": {
"color": {
"colorPresets": [ "..." ],
"gradientCustom": "none",
},
"typography": {
"fontFamily": "none"
}
}
},
"global": {
"settings": {
"typography": {
"lineHeight": "global",
"fontFamily": "global",
"fontFamilyPresets": [ "..." ],
},
}
}
} |
@jorgefilipecosta @youknowriad is this a fair summary of what we need to do? Are there alternatives you want to be considered? We'd need to solve this one before landing into core #27295 |
Hi @nosolosw I think it's a good summary, though I'm not sure I like the proposal because if the values are "block", "global", "none". It means that config only enables or disables things in a particular context (a boolean) but it doesn't seem to solve the issue for config options that are not booleans. For instance, the available "units" per context... |
Hi @nosolosw, this issue is a good summary of the discussion.
Do we have as a requirement that for a given block, themes may enable something in the global panel of that block, but disable it at the block level in the inspector? If this is not a requirement I guess adding the "*" context is enough. If this is a requirement I think it may make sense for some settings to have different values at the block level than they have at the global level but for other settings, it does not make much sense e.g: for the presets they should be the same at the global and block level. Otherwise, when the user is editing the presets we would probably need a UI that allows to edit for global and for block-level. |
This has been consolidated at #28163 which has more context about how all things fit together, so I'm closing it. |
Wanted to braindump the things discussed at #28163 to have a link to point to without polluting the main thread. The conversation still happens there. How to offer more granularity for defining where a UI control for a property should be shown? We landed at:
Example of theme.json
We need to accommodate these thoughts to other visibility concerns for the UI controls. See #28163 |
This issue is to discuss and streamline the behavior of design tools in terms of the visibility of the UI controls for users.
This topic is growing complex, so I want us to agree on a terminology:
contexts
: each block that can have styles/settings assigned. Note that some blocks (core/heading) expose many contexts (core/heading/h1, ..., core/heading/h6) and there's also the "global" context that doesn't match any block.block UI
: the block sidebar available in all editors.global UI
: the global styles sidebar available in the site editor.Use cases
Some examples of what we want theme authors to be able to do:
Some examples that we aim to streamline for users:
Coda
A related use case but that merits its own discussion is extensibility by 3rd parties. Things like disabling the typography panel entirely and provide their own, or provide a different mechanism to set font families.
The text was updated successfully, but these errors were encountered: