kadence-blocks
kadence-blocks copied to clipboard
Advance Heading options should respect add_theme_support configuration
The Advanced Heading block should probably only support font sizes defined by editor-font-sizes
(defined using add_theme_support).
At the very least, the custom Font Size slider should be hidden or disabled if disable-custom-font-sizes
is defined using add_theme_support.
As a side note, I believe the built-in Font Size component already implements the correct behavior based on these theme support options.
Perhaps Kadence should use the built-in component instead.
Looks like the only difference is that Kadence adds the px/em option. Perhaps this could be added as a separate custom interface styled in conjunction with the built-in component.
Thanks for the comment, Hmm this is a hard one.
Part of what "advanced" heading block is meant to be is to provide advanced control. Certainly more control than the normal heading and paragraph block. For heading blocks, the theme defines the size of each heading tag. That is inherited by the block but with the advanced option to change the size. And importantly for things like call to action areas it allows the font size to be set per screen size.
Given that the default sizes include 12, 16, I don't feel that those make sense in a "heading". So it's hard to make that the default way this works.
But maybe I could find a way to merge the two settings.
My current plan is to make most options able to be disabled. Hopefully by user credentials but also by a filter. It sounds like a filter to disable sizes in this block would cover what you want. And disable-custom-font-sizes should likely be looked for so I'll have to consider that. I would guess in a case like that though you don't want the user to have any advanced control and so disabling the whole block might be better.