you’re right, sorry… I was a little frustrated after two weeks evaluating.
Finally I found a solution and immediately ran into the next problem.
The idea was to allow the user to set a border for the block using the sidebar control (color, style, thickness, radius). The currently experimental block support works and does what I expect. The same applies to setting padding and margin-spacings…
"supports": {
"align": true,
"anchor": true,
...
"spacing": {
"margin": true,
"padding": true,
},
"__experimentalBorder": {
"radius": true,
"color": true,
"width": true,
"style": true,
}
},
...
const borderProps = useBorderProps(attributes);
const spacingProps = useSpacingProps(attributes);
But this doesn’t seem to work in every theme. I use the Neve theme in the purchased version, where the corresponding controls are simply missing from my blocks, and I found, that this is not a problem of my blocks… All Core-Blocks does not have the Border- and Spacing-Controls with Neve activated.
So I found out that some theme support settings are necessary to activate these controls…
add_theme_support('appearance-tools');
add_theme_support('border');
add_theme_support('custom-spacing');
So I created a child theme to set these theme supports, which actually helped. The controls are now available on all blocks using these settings. I’m currently checking with the theme manufacturer to see whether this could cause conflicts with the original theme.
The Neve-Theme (from Themeisle) is still a classic-theme without theme.json… Therefore, I could of course also store a theme.json in my child theme… but I have no idea what effects that will have on the theme and my site (side effects, etc…)
But unfortunately there is still another problem with the theme_settings, because with the “custom-spacings” I only get the padding settings. The margin settings are still missing
-
This reply was modified 1 year, 1 month ago by JĂĽrgen.