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

Caption Elements: Settings don't work for galleries #41966

Open
scruffian opened this issue Jun 27, 2022 · 2 comments
Open

Caption Elements: Settings don't work for galleries #41966

scruffian opened this issue Jun 27, 2022 · 2 comments
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended

Comments

@scruffian
Copy link
Contributor

Description

The caption element settings aren't working for galleries. When a caption color is set using theme.json, the change works for the gallery caption, but not for the images inside:
Screenshot 2022-06-27 at 09 59 57

This should probably be dealt with as part of #8030

Step-by-step reproduction instructions

  1. Add this to the element part of theme.json:
				"color": {
					"background": "pink",
					"text": "black"
				}
			}
  1. Add a gallery block to a post
  2. Check that the gallery caption has the correct colors, but the images inside do not.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@scruffian scruffian added [Block] Gallery Affects the Gallery Block - used to display groups of images Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Jun 27, 2022
@ramonjd
Copy link
Member

ramonjd commented Aug 30, 2022

Looks like a specificity issue. The elements styles are being overridden by block styles, e.g.,

background: linear-gradient(0deg, rgba($color: $black, $alpha: 0.7) 0, rgba($color: $black, $alpha: 0.3) 70%, transparent);

cc @glendaviesnz

@ramonjd ramonjd added the [Type] Bug An existing feature does not function as intended label Aug 30, 2022
@MaggieCabrera
Copy link
Contributor

We have two problems here: one is the specificity, which it's the easy part, the other is that the block is adding a gradient, and the elements are only overriding the background-color. Solving specificity will not solve this problem, it ends up doing something like:

Screenshot 2022-09-21 at 13 01 58

Applying both the gradient and background color.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants