Open dougwollison opened 4 years ago
Is this issue still valid or can we close it?
@paaljoachim It is still valid: the border radius can be disabled; but the width controls cannot be disabled as of yet.
(Note: do not close even after https://github.com/WordPress/gutenberg/pull/42079 ; that issue is for the border width; this issue here requests the width of the entire button block).
To hide width settings in CMS I just do this:
.components-button-group[aria-label="Button width"] {
display: none;
}
🤣 Not perfect but I deal with english version only so far.
I still can't believe this issue is not yet addressed. Is there a way to tackle this with wp.hooks filters to remove these settings altogether?
Is your feature request related to a problem? Please describe. Most themes I build have a strict set of button styles, which includes a limited set of border radius options. Currently, while I can override the border radius on buttons, I can't remove the block editor panel offering the border radius slider. This can result in a confusing interface for the user who sees the slider, tries playing with it, only to find it does nothing. Same goes for the Width settings panel (alternatively, I may want other width options besides 25% increments).
Other panels like the Text Settings one (up until #19208 that is) I can at least
display:none
in order to hide the Drop Cap option (which still can't be disabled).Describe the solution you'd like
The ability to, either viaThe button block should be modified so that the Border Radius and Width panels are conditional based on block support, similar to the paragraph block's typography and color settings, which can be fully disabled via supporst/block_editor_settins.add_them_support()
in PHP or some javascript API likeunregisterBlockStyle
, disable the border radius panel on buttons (or otherwise everywhere).Describe alternatives you've considered Another solution would be to add a classname to the panels so it can be hidden via the admin stylesheet.