is there a way to add gradients support for background in the core/heading block?
I've tried to
- extend
settings.supports
withgradients: true
- add gradients to theme json:
"blocks": {
"core/heading": {
"color": {
"gradients": [
{
"slug": "dark-gradient-with-stripes",
"name": "Dark gradient with stripes",
"gradient": "linear-gradient(to left bottom, rgba(125, 134, 152, .2) 15%, rgba(0, 0, 0, 0) 92.5%)"
}
]
}
}
},
Your help is really appreciated.
is there a way to add gradients support for background in the core/heading block?
I've tried to
- extend
settings.supports
withgradients: true
- add gradients to theme json:
"blocks": {
"core/heading": {
"color": {
"gradients": [
{
"slug": "dark-gradient-with-stripes",
"name": "Dark gradient with stripes",
"gradient": "linear-gradient(to left bottom, rgba(125, 134, 152, .2) 15%, rgba(0, 0, 0, 0) 92.5%)"
}
]
}
}
},
Your help is really appreciated.
Share Improve this question asked Feb 9, 2022 at 19:12 Karolína VyskočilováKarolína Vyskočilová 4291 gold badge8 silver badges23 bronze badges 5 |1 Answer
Reset to default 0No, currently gradient support in the heading block has not been implemented.
You can declare that it supports it in theme.json or via supports
, but there is nothing in the block to read that data in and use it. Gradient support has to be built into a block, it can't be inserted arbitrarily.
The closest you can get is with predefined variants or styles, a custom block, or wrapper the heading in a group/cover block. Composition not modification.
theme.json
aren't generic interchangeable features that can be applied to any block, and declaring that a block has gradient support intheme.json
doesn't enable or insert that functionality into a block, code needs writing at the other end to read and use that configuration, it's purely a configuration file – Tom J Nowell ♦ Commented Feb 10, 2022 at 10:55