You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Block] CoverAffects the Cover Block - used to display content laid over a background image[Block] ImageAffects the Image Block[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Feature] MediaAnything that impacts the experience of managing media[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Status] In ProgressTracking issues with work in progress
There should be a way to disable the duotone UI from theme.json
What is your proposed solution?
I think for colors, if you set an empty palette [] and set custom to false in theme.json the control disappears entirely, so maybe something similar could work here too
Reacted by Birgit Pauli-Haack, chthonic-ds, Will Skora and Mark Root-Wiley
I think for colors, if you set an empty palette [] and set custom to false in theme.json the control disappears entirely, so maybe something similar could work here too
@mtias and @youknowriad I confirmed that this doesn't actually work for colors. Setting the values in the theme.json as specified still just shows the default palette.
These are the relevant parts of the theme.json config that I have:
Setting gradients or palette to false causes errors just like duotone.
Since there isn't already a system for disabling block supports via theme.json, I think having a separate setting to enable and disable them makes more sense. Palettes are used outside of block supports, so it may make sense that you want the supports disabled, but you still want the color/gradient/duotone palettes in other places like for border color for examaple.
I propose adding a block-supports option directly under settings to enable or disable the supports.
We default to having all block supports enabled. Setting to a value of false disables the block support. The support won't be added unless both the theme and the block have it enabled.
[Block] CoverAffects the Cover Block - used to display content laid over a background image[Block] ImageAffects the Image Block[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Feature] MediaAnything that impacts the experience of managing media[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Status] In ProgressTracking issues with work in progress
Activity
ajlende commentedon May 14, 2021
@mtias and @youknowriad I confirmed that this doesn't actually work for colors. Setting the values in the theme.json as specified still just shows the default palette.
These are the relevant parts of the theme.json config that I have:
And this is what I see:
Setting
gradientsorpalettetofalsecauses errors just likeduotone.Since there isn't already a system for disabling block supports via theme.json, I think having a separate setting to enable and disable them makes more sense. Palettes are used outside of block supports, so it may make sense that you want the supports disabled, but you still want the color/gradient/duotone palettes in other places like for border color for examaple.
I propose adding a
block-supportsoption directly undersettingsto enable or disable the supports.We default to having all block supports enabled. Setting to a value of
falsedisables the block support. The support won't be added unless both the theme and the block have it enabled.What do you think?
youknowriad commentedon May 17, 2021
I think you can disable colors by doing two things, setting the palette to
[]andcustomtofalse. Confirm @jorgefilipecosta ?erikjoling commentedon May 19, 2021
I found out I can disable colors and gradients by setting:
I believe this mimics the behavior of add_theme_support where you had to add:
But it's quite confusing and I haven't found a solution for duotone yet.
erikjoling commentedon May 19, 2021
#31986
ajlende commentedon May 19, 2021
So it sounds like for this, in order to be consistent with existing settings, there are a few things that need to happen:
DuotoneControlneeds to be disabled whencolor.duotone === nullto hide the toolbar item.ColorListPickerin theDuotonePickerdropdown needs to be disabled whencolor.palette === null.CustomDuotoneBarin theDuotonePickerdropdown needs to be disabled (but probably still shown?) whencolor.custom === false.Does that sound accurate?
youknowriad commentedon May 19, 2021
That makes sense yes.
oandregal commentedon Jul 8, 2021
After some conversation at #33280 I've prepared #33295 to update the logic that handles the visibility of the duotone control.