This repository was archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 215
Featured Item: Fix default color being overridden by themes #6492
Merged
sunyatasattva
merged 4 commits into
trunk
from
fix/6489-featured-product-color-overridden-by-theme
May 31, 2022
Merged
Featured Item: Fix default color being overridden by themes #6492
sunyatasattva
merged 4 commits into
trunk
from
fix/6489-featured-product-color-overridden-by-theme
May 31, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This fix applies the user selected color on the block's parent element.
Contributor
|
Size Change: +66 B (0%) Total Size: 862 kB
ℹ️ View Unchanged
|
Aljullu
approved these changes
May 31, 2022
Contributor
Aljullu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works perfectly! I left one minor comment about some typos in a comment, but besides that LGTM.
| // This is hardcoded because border is not yet included in Gutenberg's | ||
| // official types. | ||
| style: { border?: { radius?: number } }; | ||
| // This is hardcoded because and color ar not yet included |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there are some typos in this comment.
sunyatasattva
added a commit
that referenced
this pull request
Jun 7, 2022
Gutenberg uses two different attributes for text colors: * `style.color.text`, and * `textColor` However, the second one is used only when a color from the default palette is selected AND the post is saved and reloaded. With this fix we use the human readable string from the default palette as a CSS variable. Please note that while Gutenberg correctly assigns the appropriate CSS class to render the right color, the problem is that if the color is handled by a class, it can be overridden for example by themes. See #6492
7 tasks
gigitux
pushed a commit
that referenced
this pull request
Jun 7, 2022
Gutenberg uses two different attributes for text colors: * `style.color.text`, and * `textColor` However, the second one is used only when a color from the default palette is selected AND the post is saved and reloaded. With this fix we use the human readable string from the default palette as a CSS variable. Please note that while Gutenberg correctly assigns the appropriate CSS class to render the right color, the problem is that if the color is handled by a class, it can be overridden for example by themes. See #6492
gigitux
pushed a commit
that referenced
this pull request
Jun 7, 2022
Gutenberg uses two different attributes for text colors: * `style.color.text`, and * `textColor` However, the second one is used only when a color from the default palette is selected AND the post is saved and reloaded. With this fix we use the human readable string from the default palette as a CSS variable. Please note that while Gutenberg correctly assigns the appropriate CSS class to render the right color, the problem is that if the color is handled by a class, it can be overridden for example by themes. See #6492
gigitux
added a commit
that referenced
this pull request
Jun 7, 2022
* Empty commit for release pull request * Add changelog for the 7.8.0 release * Add testing notes for 7.8.0 release * move legacy payment processing to its own class (#6519) * update changelog and testing instructions after the cherry-pick * add link * Featured Item: Fix colors from default palette not being applied (#6525) Gutenberg uses two different attributes for text colors: * `style.color.text`, and * `textColor` However, the second one is used only when a color from the default palette is selected AND the post is saved and reloaded. With this fix we use the human readable string from the default palette as a CSS variable. Please note that while Gutenberg correctly assigns the appropriate CSS class to render the right color, the problem is that if the color is handled by a class, it can be overridden for example by themes. See #6492 * upload new zip * update changelog * Revert "Remove Combobox patch (#6465)" (#6531) This reverts commit 617f297. * upload new zip * Bumping version strings to new version. Co-authored-by: github-actions <[email protected]> Co-authored-by: Luigi <[email protected]> Co-authored-by: Seghir Nadir <[email protected]> Co-authored-by: Lucio Giannotta <[email protected]> Co-authored-by: Albert Juhé Lluveras <[email protected]>
8 tasks
gigitux
added a commit
that referenced
this pull request
Jun 20, 2022
* Empty commit for release pull request * Add changelog for the 7.8.0 release * Add testing notes for 7.8.0 release * move legacy payment processing to its own class (#6519) * update changelog and testing instructions after the cherry-pick * add link * Featured Item: Fix colors from default palette not being applied (#6525) Gutenberg uses two different attributes for text colors: * `style.color.text`, and * `textColor` However, the second one is used only when a color from the default palette is selected AND the post is saved and reloaded. With this fix we use the human readable string from the default palette as a CSS variable. Please note that while Gutenberg correctly assigns the appropriate CSS class to render the right color, the problem is that if the color is handled by a class, it can be overridden for example by themes. See #6492 * upload new zip * update changelog * Revert "Remove Combobox patch (#6465)" (#6531) This reverts commit 617f297. * upload new zip * Bumping version strings to new version. * Fix MD lint errors and fix conflicts * Empty commit for release pull request * Release: 7.8.3 (#6602) * Fix PHP notice in Mini Cart when prices included taxes (#6537) * Empty commit for release pull request * Add changelog to readme.txt * Update versions * Add Testing steps for version 7.8.1 * Bumping version strings to new version. * Empty commit for release pull request * Empty commit for release pull request * Replace instances of wp_is_block_theme() with wc_current_theme_is_fse_theme() (#6590) * update changelog and testing instructions * Empty commit for release pull request * upload zip * Bumping version strings to new version. * Fix images hidden by default in Product grid blocks (#6599) * update changelog and testing instructons * Bumping version strings to new version. Co-authored-by: Albert Juhé Lluveras <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Luigi <[email protected]> * fix MD lint errors * fix sort deps Co-authored-by: github-actions <[email protected]> Co-authored-by: Seghir Nadir <[email protected]> Co-authored-by: Lucio Giannotta <[email protected]> Co-authored-by: Albert Juhé Lluveras <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This was referenced Aug 30, 2022
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a problem in which certain themes would override the default color of the Featured Item blocks, possibly leading to contrast and unexpected issues. While fixing this, I also noticed that custom colors wouldn't be applied to the text, only palette colors would, so that's fixed too.
Fixes #6489
Screenshots
User Facing Testing
WooCommerce Visibility
Changelog