Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Featured Items: Inline style color defaults override Global Styles #7042

Closed
danielwrobert opened this issue Sep 1, 2022 · 1 comment · Fixed by #7036
Closed

Featured Items: Inline style color defaults override Global Styles #7042

danielwrobert opened this issue Sep 1, 2022 · 1 comment · Fixed by #7036
Assignees
Labels
block: featured category Issues related to the Featured Category block, block: featured product Issues related to the Featured Product block. type: bug The issue/PR concerns a confirmed bug.

Comments

@danielwrobert
Copy link
Contributor

danielwrobert commented Sep 1, 2022

Summary

The text color defaults for the Featured Product and Featured Category blocks are set as inline styles. The problem is that the inline styles also override any changes to the block's Global Styles in the Site Editor.

To reproduce

Steps to reproduce the behavior:

  1. Ensure you have a block theme active (i.e., Twenty Twenty-Two).
  2. Go to Appearance > Editor (Beta).
  3. Click on the Global Styles panel and select the Blocks section.
  4. Scroll down to the Featured Product or Featured Category block and edit the text and the background Global Styles.
  5. Notice that the background changes but the text remains white.

Expected behavior

The text setting should also be adjustable when edited via Global Styles.

Screenshots

Global Styles Panel Global Styles Block Setting
CleanShot 2022-08-31 at 16 48 11 CleanShot 2022-09-01 at 14 31 05

Additional context

The purpose for the inline default, as implemented in #6492, was to ensure the white text over the overlay, as some theme styles (i.e., Storefront) were potentially interfering.

Now that we have Block Themes and Global Styles becoming more prevalent, we should ensure that our blocks are editable via the controls offered. We can add an editor-specific style for added specificity but we do not want so much specificity that the Global Styles are overridden, as they are currently. IMO, the theme styles should be responsible to ensure they are not unintentionally overriding global settings.

cc @Aljullu and @sunyatasattva for your input, as you were both involved in #6489 and #6492.

@danielwrobert danielwrobert added type: bug The issue/PR concerns a confirmed bug. needs feedback labels Sep 1, 2022
@danielwrobert danielwrobert self-assigned this Sep 1, 2022
@danielwrobert danielwrobert added block: featured category Issues related to the Featured Category block, block: featured product Issues related to the Featured Product block. labels Sep 1, 2022
@danielwrobert danielwrobert changed the title Inline style color defaults override Global Styles for Featured Product / Category blocks Inline style color defaults override Global Styles for Featured Item blocks Sep 1, 2022
@danielwrobert danielwrobert changed the title Inline style color defaults override Global Styles for Featured Item blocks Featured Items: Inline style color defaults override Global Styles Sep 1, 2022
@sunyatasattva
Copy link
Contributor

Nice catch @danielwrobert. It is indeed tricky, as we should decide on a specific hierarchy on how styles are applied. And that's more a difficult architecture question than anything. Your proposal to have themes take their own responsibilities seems logical. After all, we do the same with other plugins: we can't account for all the things plugins could break and we assume they should take responsibility for that.

However, this is definitely a conversation that requires some edge case thinking, or we risk ending up ping-ponging through some different solutions, I feel. Maybe a P2?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: featured category Issues related to the Featured Category block, block: featured product Issues related to the Featured Product block. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants