2

I would like to know if it is possible to set a default Overlay color for the Core Cover block using theme.json, so that when a new Cover block is added, that Overlay color is pre-set rather than having no color selected.

I know you can create a custom palette for the Cover block like so:

"settings": {
    "blocks": {
        "core/cover": {
            "color": {
                "palette": [
                    {
                        "color": "#ffffff",
                        "name": "White",
                        "slug": "white"
                    }
                ]
            }
        }
    }
}

But this just restricts the color palette - it does not set a color when a new Cover block is added to the Editor.

2
  • Not yet possible to automatically set the color by default (github.com/WordPress/gutenberg/issues/27809).
    – Will
    Commented Oct 30, 2023 at 16:36
  • 1
    @Will If you want to add this as an answer, I'll accept it. Disappointing, but a solid answer nonetheless.
    – WebElaine
    Commented Oct 30, 2023 at 20:24

1 Answer 1

2
+50

Unfortunately, this is not yet possible. This has been requested at https://github.com/WordPress/gutenberg/issues/27809 and if you have a github account, you can subscribe to the issue and keep track of its progress.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.