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: Overlay background possible regression #26545

Closed
sirreal opened this issue Oct 28, 2020 · 5 comments · Fixed by #26569
Closed

Cover Block: Overlay background possible regression #26545

sirreal opened this issue Oct 28, 2020 · 5 comments · Fixed by #26569
Assignees
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image CSS Styling Related to editor and front end styles, CSS-specific issues. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@sirreal
Copy link
Member

sirreal commented Oct 28, 2020

Describe the bug

The style of Cover block background overlays has changed in Gutenberg 9.2. This is likely a regression from #26133.

Specifically, this section changes the style of the overlay:

Before #26133, there was a background-color: $black; rule which was inherited by the ::before:

&.has-background-dim {
background-color: $black;
&::before {
content: "";
background-color: inherit;
}
}

After, there is just an inherit:

&.has-background-dim::before {
content: "";
background-color: inherit;
}

To reproduce

  1. Use Gutenberg 9.1 (download link)
  2. Create a post with a Cover block and an overlay.
  3. View the post on the frontend and notices the background overlay.
  4. Upgrade Gutenberg to 9.2 (download link)
  5. View the same post on the frontend and notice that the background overlay is different.

Expected behavior
I expected the same block to render the same across 9.1 - 9.2 Gutenberg versions.

Screenshots

Screen Shot 2020-10-28 at 16 02 34

Editor version (please complete the following information):

  • WordPress version: 5.5
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? gutenberg plugin
  • If the Gutenberg plugin is installed, which version is it? 9.1 ➡️ 9.2
@sirreal sirreal added [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release [Block] Cover Affects the Cover Block - used to display content laid over a background image CSS Styling Related to editor and front end styles, CSS-specific issues. labels Oct 28, 2020
@sirreal
Copy link
Member Author

sirreal commented Oct 28, 2020

Pinging a few folks who interacted on #26133 to verify: @jasmussen @mkaz @stokesman

@stokesman
Copy link
Contributor

I was aware that #26133 would create this difference and perhaps I should have highlighted that point in my PR. Just to be clear it only affects cover blocks that have no color selected. I'd say the change is worth keeping and maybe there's a way to preserve the old presentation for this particular case without going back to the old CSS since that is problematic in other ways. I actually have a couple of ideas but I'll look into that.

Thanks, @sirreal for bringing this up. It made me realize an oversight in #26133 was that the useCoverIsDark hook should have been revised to not assume the black color when no color has been selected. How do you make those rad little file excerpts of particular line numbers, btw?

@inaikem
Copy link

inaikem commented Oct 29, 2020

I'm seeing this issue on a live site with several hundred posts being affected -- losing a semi-opaque background colour -- by this change.

jasmussen added a commit that referenced this issue Oct 29, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Oct 29, 2020
sirreal added a commit that referenced this issue Oct 29, 2020
The default Cover block overlay background was removed. This changed the
style of existing blocks on existing sites.

Restore the default background in such a way that it does not conflict
with theme-provided background-color styles and there is no need to
artificially add extra specificity.

Fix regression: #26545
@sirreal
Copy link
Member Author

sirreal commented Oct 29, 2020

I was aware that #26133 would create this difference and perhaps I should have highlighted that point in my PR. Just to be clear it only affects cover blocks that have no color selected. I'd say the change is worth keeping and maybe there's a way to preserve the old presentation for this particular case without going back to the old CSS since that is problematic in other ways. I actually have a couple of ideas but I'll look into that.

Please see #26569 for the proposed fix.

Thanks, @sirreal for bringing this up. It made me realize an oversight in #26133 was that the useCoverIsDark hook should have been revised to not assume the black color when no color has been selected.

With #26569 would that be an issue? (I'm unfamiliar with useCoverIsDark).

How do you make those rad little file excerpts of particular line numbers, btw?

😉 You can reference code inline from the same repository. Highlighting some lines in the repo and selecting "Copy Permalink", then put that URL on its own line and they'll show up as snippets.

@stokesman
Copy link
Contributor

@sirreal, in #26569, useCoverIsDark will be fine as is. Thanks for the tip on the code refs. Funny cause I was trying that but it wasn't showing in the preview so I thought it wouldn't work.

sirreal added a commit that referenced this issue Nov 2, 2020
* Restore default Cover overlay background

The default Cover block overlay background was removed. This changed the
style of existing blocks on existing sites.

Restore the default background in such a way that it does not conflict
with theme-provided background-color styles and there is no need to
artificially add extra specificity.

Fix regression: #26545
tellthemachines pushed a commit that referenced this issue Nov 11, 2020
* Restore default Cover overlay background

The default Cover block overlay background was removed. This changed the
style of existing blocks on existing sites.

Restore the default background in such a way that it does not conflict
with theme-provided background-color styles and there is no need to
artificially add extra specificity.

Fix regression: #26545
tellthemachines added a commit that referenced this issue Nov 12, 2020
* Cover block: Restore default overlay background (#26569)

* Restore default Cover overlay background

The default Cover block overlay background was removed. This changed the
style of existing blocks on existing sites.

Restore the default background in such a way that it does not conflict
with theme-provided background-color styles and there is no need to
artificially add extra specificity.

Fix regression: #26545

* Limit the interface skeleton to a max width of 100% to prevent some blocks managing to exceed the width (#26552)

* Cover Block: Restore opacity controls (#26625)

* Fix image block centering when resizing to a smaller size (#26376)

* Fix image block centering when resizing to a smaller size

* Revert previous 100% width fix

* Remove display: table when image block is resized to avoid centering of block

* Match frontend classes for alignment in editor

* Gallery: Remove caption fallback for alt attribute (#26676)

* Fix quote block default alignment (#26680)

* Gallery: Remove obsolete deprecation entry (#26736)

* Do not apply text color if it is being overriden (#24626)

* Fix: Preset colors don't work on button block style outline (#26707)

* Tests: Add fixture for Column deprecation (#26774)

* Fix/column width units (#26757)

* Fix issues with different units in column widths

* Columns with fixed width should keep width on recalculation

* Address review feedback

* fix undefined index notice in Social Link Block (#25663)

* fix undefined index notice

* use isset instead of array_key_exists check

* Update packages/block-library/src/social-link/index.php

Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>

Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>

* Adds in missing styling for toolbar when using text-only setting (#26769)

* Adds in missing styling for toolbar when using text-only setting

* Increases margin

* Moves style to correct file

* Inserter: Fix 'Browse All' in Quick Inserter (#26443)

* Inserter: Fix 'Browse All' in Quick Inserter

Maintain the insertion point in @wordpress/block-editor state when
moving from the Quick Inserter to the Inserter.

This fixes a bug where the insertion point is wrong after clicking a
block appender and selecting 'Browse All'.

Care is taken to not regress a previous bug where the insertion point is
wrong after clicking an inline insertion button and selecting 'Browse
ALl'.

* Inserter: Fix typo

Co-authored-by: Daniel Richards <daniel.richards@automattic.com>

* Call getBlockInsertionPoint once

* Add useSelect dependencies

* Make setInsertionPoint unstable

* Avoid setting `isVisible` state when `SET_INSERTION_POINT` is triggered

* Make index required and clarify rootClientId usage

* Split insertionPoint into two reducers

* Fix getInsertionPoint selector that expects default state of reducer to be null

* Avoid resetting insertionPoint state on HIDE_INSERTION_POINT

Co-authored-by: Daniel Richards <daniel.richards@automattic.com>

Co-authored-by: Jon Surrell <jon.surrell@automattic.com>
Co-authored-by: Jacopo Tomasone <Copons@users.noreply.github.com>
Co-authored-by: Daniel Richards <daniel.richards@automattic.com>
Co-authored-by: Bernie Reiter <ockham@raz.or.at>
Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
Co-authored-by: Oliver Juhas <webmandesign@users.noreply.github.com>
Co-authored-by: Jorge Costa <jorge.costa@automattic.com>
Co-authored-by: Fabian Kägy <mail@fabian-kaegy.de>
Co-authored-by: Tammie Lister <tammie@automattic.com>
Co-authored-by: Robert Anderson <robert@noisysocks.com>
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 CSS Styling Related to editor and front end styles, CSS-specific issues. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
4 participants