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

Block Patterns: Coverblock is missing a CSS class #20825

Closed
carolinan opened this issue Mar 12, 2020 · 2 comments · Fixed by #20921
Closed

Block Patterns: Coverblock is missing a CSS class #20825

carolinan opened this issue Mar 12, 2020 · 2 comments · Fixed by #20921
Assignees
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

When adding the gradient coverblock via the Block Patterns in 7.7.0
the has-background-gradient CSS class is missing from the wrapping div on the front.

The class is added correctly in the editor.

This means that the block does not look the same on the front and in the editor and that the default opacity: 0.5; of the dim is much more difficult to remove.

To reproduce
Steps to reproduce the behavior:

  1. Add the coverblock from the Block Patterns.
  2. Save
  3. View the front
  4. See the default 0.5 opacity dim cover the block.

-If I manually add a new cover block with the same gradient, or if I change the gradient of the existing block, then the class is added on the front.

Expected behavior
I expect the class to be added, so that block on the front looks identical to the block in the editor.

Desktop (please complete the following information):

  • OS: Win10
  • Browser: Chrome Version 80.0.3987.132

Additional context

  • Please add the version of Gutenberg you are using in the description.
    Version 7.7.0

WordPress Version 5.3.2

@youknowriad
Copy link
Contributor

I looked deeper here and it seems it's not a patterns issue but the Cover image doesn't add the has-background-gradient className if a palette gradient is used, it's only added when custom gradients are used.

I believe that's probably consistent about how colors work (right @jorgefilipecosta), so it's intended.

that said, there's still a patterns bug, the pattern shouldn't be using aa "Palette" gradient because depending on the theme, the chosen gradient class might not be present.

So the action item here would be to update the pattern to use a custom gradient.

@youknowriad youknowriad added [Block] Cover Affects the Cover Block - used to display content laid over a background image [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended Good First Issue An issue that's suitable for someone looking to contribute for the first time labels Mar 12, 2020
@mtias
Copy link
Member

mtias commented Mar 12, 2020

It's using the class instead of a custom gradient on purpose to see what sort of issues we run into.

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 [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants