Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover block without forced color/image #38144

Open
strarsis opened this issue Jan 21, 2022 · 6 comments
Open

Cover block without forced color/image #38144

strarsis opened this issue Jan 21, 2022 · 6 comments
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement.

Comments

@strarsis
Copy link
Contributor

strarsis commented Jan 21, 2022

What problem does this address?

Sometimes a core/cover block is heavily styled by a theme, e.g.
by adding complex decorative elements and background effects to it.

The cover/block currently forces a color or image selection at insertion.
The theme then has to forcefully hide any color or image before applying its own complex styles.
Alternatively the theme needs to rely on the end user cooperation that 0 opacity is applied.

What is your proposed solution?

Make the color/image selection optional and not mandatory as it is the case right now.

@karmatosed karmatosed added the Needs Technical Feedback Needs testing from a developer perspective. label Jan 21, 2022
@carolinan
Copy link
Contributor

I do run into this. Part of the problem is that the cover block is the only option we have for layering blocks over other blocks, and sometimes the block options are not suitable for what we are trying to create.

@skorasaurus
Copy link
Member

I haven't tested it, but it sounds like from #46148 you may be able to disable the color for the cover block using theme.json ?

@skorasaurus skorasaurus added the [Block] Cover Affects the Cover Block - used to display content laid over a background image label Jan 22, 2023
@jordesign
Copy link
Contributor

#50115 suggests to me that it's possible to disable colors for the block - does this sufficiently resolve this issue for you @strarsis (and @carolinan for a gut check)?

@strarsis
Copy link
Contributor Author

#50115 suggests to me that it's possible to disable colors for the block - does this sufficiently resolve this issue for you @strarsis (and @carolinan for a gut check)?

Disable color for all blocks of this block type or only for specific blocks? One may still want to use a solid background color in some blocks.

@jordesign
Copy link
Contributor

Disable color for all blocks of this block type or only for specific blocks? One may still want to use a solid background color in some blocks.

Ah yes - so the theme.json approach wouldn't work for that then.

@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Sep 14, 2023
@t-hamano
Copy link
Contributor

I think it is also possible to disable only the color control of the cover block:

theme.json
{
	"$schema": "https://schemas.wp.org/trunk/theme.json",
	"version": 2,
	"settings": {
		"appearanceTools": true,
		"layout": {
			"contentSize": "840px",
			"wideSize": "1100px"
		},
		"blocks": {
			"core/cover": {
				"color": {
					"custom": false,
					"customDuotone": false,
					"customGradient": false,
					"duotone": [],
					"gradients": [],
					"link": false,
					"palette": [],
					"text": false,
					"background": false,
					"defaultGradients": false,
					"defaultPalette": false
				}
			}
		}
	}
}

However, when inserting a cover block, the color palette simply disappears and you are forced to insert an image.

cover-without-color

Personally, I think that the cover block, as the name suggests, is intended to have some kind of background. If you don't need a background, can you use a group block instead? I think the group block covers many of the things that can be done with the cover block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

6 participants