Skip to content
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

Provide means to enable/disable Global-level configuration of blocks #34206

Closed
pbking opened this issue Aug 20, 2021 · 1 comment
Closed

Provide means to enable/disable Global-level configuration of blocks #34206

pbking opened this issue Aug 20, 2021 · 1 comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement.

Comments

@pbking
Copy link
Contributor

pbking commented Aug 20, 2021

What problem does this address?

While it's (theoretically*) possible for themes (via theme.json) to control what aspects a block has available for user control this disables access BOTH Globally (in the FSE Global Styles 'By Block' panel) as well as Locally (Block instance controls).

Because the two systems (Global ..er.. Global Styles and Local Block Styles) work differently it may be necessary to allow for GLOBAL but not LOCAL or LOCAL but not GLOBAL configuration of settings.

As an example; In the case of Blockbase the Global Style Mechanism for configuring button colors currently results in a poor user experience (hover states don't follow color choices, padding controls don't work, etc). It is desired that the Global Style configuration for Buttons be disabled by the theme (preferably just COLORS and PADDING, though disabling ALL Global Style Configurations for Buttons would also be groovy). LOCAL (block instance) controls of colors and padding work just as the user would expect and should remain in place.

Buttons have a long way to go before they can be appropriately styled Globally and until that effort is complete allowing a theme to decide and control which aspects of the GLOBAL style are provided to the user would mitigate that.

What is your proposed solution?

Provide configuration options in theme.json that allows for the enabling and disabling of Block-specific configuration controls in the FSE Global Styles panel.

Something such as:

{
    "version": 1,
    "settings": {
        "globalStyles": {
            "blocks": {
                "core/button": {
                    "color": {
                        "custom": false,
                    }
   ...
  • Note that the ability to disable custom color controls at the ANY level for buttons doesn't seem to work either, though that's a separate issue as the mechanism is at least documented.
@stacimc stacimc added [Type] Enhancement A suggestion for improvement. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Design Feedback Needs general design feedback. Needs Technical Feedback Needs testing from a developer perspective. labels Aug 23, 2021
@karmatosed
Copy link
Member

I don't think this needs design feedback as feels like it's on a non-interface level but I do like the idea of complete disabling myself. For now I am going to triage away that label though.

@karmatosed karmatosed removed the Needs Design Feedback Needs general design feedback. label Sep 17, 2021
@pbking pbking closed this as completed Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants