-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Fix Filter by Price slider color to use current in RTL languages instead of hardcoded purple #57687
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
Fix Filter by Price slider color to use current in RTL languages instead of hardcoded purple #57687
Conversation
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.
Thanks for working on this, @amitraj2203! It's testing as described and it fixes the issue:
Before | After |
---|---|
I just left one comment inline, as I think we can take the opportunity to clean up a couple of CSS lines.
Testing environment
- WordPress 6.8 local dev environment
- Plugins: WooCommerce Beta Tester
- Theme: Twenty Twenty-Five
- Store creation: April 24th 2025
- Store size: small
@@ -260,7 +260,7 @@ | |||
.rtl { | |||
.wc-block-components-price-slider__range-input-progress { | |||
--track-background: linear-gradient(to left, transparent var(--low), var(--range-color) 0, var(--range-color) var(--high), transparent 0) no-repeat 0 100% / 100% 100%; | |||
--range-color: #{$studio-woocommerce-purple-30}; | |||
--range-color: currentColor; |
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.
I believe we can remove this line altogether, as we will inherit the color from here:
woocommerce/plugins/woocommerce/client/blocks/assets/js/base/components/price-slider/style.scss
Line 112 in ca19d38
--range-color: currentColor; |
And while not related to the issue, we could go a step further and also remove these ones:
woocommerce/plugins/woocommerce/client/blocks/assets/js/base/components/price-slider/style.scss
Lines 275 to 277 in ca19d38
.wc-block-components-price-slider__range-input-progress { | |
--range-color: currentColor; | |
} |
I didn't test yet, but I think they aren't needed either.
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.
Thanks for the review, @Aljullu.
I've removed those and tested in TT, TT1, and TT5 — it's working fine. However, in the Storefront theme:
- With an RTL language, both the editor and frontend are still picking up the purple color.
- For LTR language in the editor, it's also still picking up the purple color, probably due to this rule.
I'm wondering if the scope of this change is limited to only the TT themes, or if we should also update the CSS in the Storefront theme.
Heading | Image |
---|---|
Storefront Frontend RTL | |
Storefront Editor RTL | |
Storefront Editor LTR |
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.
Good catch with that issue in Storefront, @amitraj2203! In Storefront it's expected that the slider follows the accent color. For example, this is how it looks if I set the color to green in the Customizer:
LTR | RTL |
---|---|
So in this case, the issue is with LTR languages because the accent color is not properly applied. Apparently, we need to increase the specificity of this selector so it 'wins' over the WC core selector. I think adding the tag name would be enough (div.wc-block-components-price-slider__range-input-progress { ... }
). Do you want to open a PR for that? 🙂
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.
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.
Yes, please! 🙇
(Ups, sorry, I approved the PR by mistake, I think we should try to implement the changes I suggested before merging 😅 ) |
Testing GuidelinesHi , Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
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.
This looks perfect, @amitraj2203! Thanks for your help with another fix! 🙌
Submission Review Guidelines:
Changes proposed in this Pull Request:
This PR fixes an issue where the
Filter by Price Controls
block's slider color is hardcoded to purple in RTL languages, instead of inheriting the current font color as it does in LTR languages.Closes #54148
Screenshots or screen recordings:
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Create a page and add the
Product Collection
blocks.Switch to Code editor mode.
Copy and paste the following code to add the
Filter by Price Controls
block, then return to Visual editor mode.Filter by Price Controls Block
and choosing any other color
Changelog entry
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment