Skip to content

Update dynamic theme fixes config for *.iherb.com#15685

Open
arturstat wants to merge 4 commits into
darkreader:mainfrom
arturstat:patch-469458
Open

Update dynamic theme fixes config for *.iherb.com#15685
arturstat wants to merge 4 commits into
darkreader:mainfrom
arturstat:patch-469458

Conversation

@arturstat

Copy link
Copy Markdown
Contributor

Need to use more specific selector in order to define text color only on the desired images.

Need to use more specific selector in order to define text color only on the desired images.
@arturstat arturstat marked this pull request as draft June 29, 2026 14:22
div[data-qa-element^="rewards-landing-faq-item-collapse"]::after
div.policy-accordion-item img
div.cms-accordion-switch-btn
span.cms-bubble-text

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore after modifying the CSS rule below.

Comment thread src/config/dynamic-theme-fixes.config Outdated

CSS
div.custom-flex-box-item span,
div:is(.cms-banner-container, .rewards-banner-container) div.custom-flex-box-item span,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use more specific selectors in order to avoid issues elsewhere.

@arturstat arturstat marked this pull request as ready for review June 29, 2026 14:25
@arturstat arturstat marked this pull request as draft June 30, 2026 19:32
div.cms-accordion-switch-btn
div.myaccount-container div[data-an-element="base-info"] > div:first-of-type svg
div.house-brand-content-container div.section-2-img img:not([alt$="icon"])
div#hamburger-menu-base img

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icons in the sidepanel of the mobile version.
https://pt.iherb.com/

div.myaccount-container div[data-an-element="base-info"] > div:first-of-type svg
div.house-brand-content-container div.section-2-img img:not([alt$="icon"])
div#hamburger-menu-base img
a[class$="SocialIcons"] img

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Social icons in the footer of the mobile version.
https://pt.iherb.com/

div.house-brand-content-container div.section-2-img img:not([alt$="icon"])
div#hamburger-menu-base img
a[class$="SocialIcons"] img
img[src$="/iHerb_Vitacost.png"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a.menu-link.menu-pill-wrapper span,
div[data-qa-element="SubscribeListContainer"] h4,
div.quality-description {
div.slider-container a > div:nth-of-type(2),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we are using IGNORE IMAGE ANALYSIS on all elements in the website.
These selectors define black color on text over images that have lighter backgrounds.
These apply to the mobile version of the website.
https://pt.iherb.com/

Comment thread src/config/dynamic-theme-fixes.config
Comment thread src/config/dynamic-theme-fixes.config Outdated
div.house-brand-content-container div:is(.section-1, .section-2) {
background-image: none !important;
}
.parent-selector {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines R792 to R819 fix backgrounds in the mobile and desktop version of the following pages:
https://pt.iherb.com/c/california-gold-nutrition
https://pt.iherb.com/c/cgn-digestive-health
https://pt.iherb.com/c/california-gold-nutrition-pure-sports
The backgrounds are images which are light and the text is also light.
The purpose is for the surrounding images and the text to remain visible.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can not find any element with class .parent-selector on mentioned pages.
Can not confirm this part of fix is needed.

@arturstat arturstat Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.parent-selectror is not needed.
Will delete the respective lines.

div[class^="scan-qr-login_qrCode"] svg *
div.shipping-textbox-subheader span
div.sc-social-media-list *
:is(section, div).footer-banner-container *

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The green rewards area near the bottom.
https://pt.iherb.com/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what we want to fix here:

Image

Maybe you have some other example what this line will fix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get white text in that area.
This line fixes it.
Screenshot 2026-07-05 010417


CSS
div.cms-banner-container div.custom-flex-box-item span,
div.cms-banner-container div.custom-flex-box-item,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text over the images near the top of the mobile version.
https://pt.iherb.com/

CSS
div.cms-banner-container div.custom-flex-box-item span,
div.cms-banner-container div.custom-flex-box-item,
div.cms-banner-container div.custom-flex-box-item span:not(.custom-button),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exclude text inside the dark green button.
https://pt.iherb.com/

Comment thread src/config/dynamic-theme-fixes.config Outdated
div[data-qa-element="SubscribeListMobileContainer"]
> div:first-of-type > div > div > div:first-of-type > h2 > div {
> div:first-of-type > div > div > div:first-of-type > h2 > div,
div.professional-brands-intro div.brands-header:not(:has(> div > div > img)) * {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text over the image near the top of the mobile version.
https://pt.iherb.com/c/sports
The purpose of the :not is to exclude the white text over the brands section:
https://pt.iherb.com/
https://pt.iherb.com/c/professional-brands

@arturstat arturstat marked this pull request as ready for review July 1, 2026 23:16
Comment thread src/config/dynamic-theme-fixes.config Outdated
div.slider-container div[class$="IconCategories"] img,
div.slider-container div[class$="BrandsSubNav"] img,
div.slider-container div[class$="SpecialsCarousel"] img,
div.slider-container div[class$="CategoriesCarousel"] img,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking about making this fixes little smaller. Maybe you could use
div.slider-container img, which would work for all five entries?

Comment thread src/config/dynamic-theme-fixes.config Outdated
img.shop-by-logo-section-image,
button.thumbnail-item:not(.selected):hover img {
button.thumbnail-item:not(.selected):hover img,
img[style^="mix-blend-mode: darken"],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing this gives me idea we should check if

img {
 mix-blend-mode: normal !important;
}

Would not be better. In most cases all pictures on some shop sites should not have any mix-blend-mode set as they will be almost invisible in Dark Reader's Dark mode.
Entering specific selector will give us new PRs every time page will add something new not included in fixes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suggestion seems to be possible without any issues.

div.slider-container div[class$="ShopByLogosCarousel"] a > div > div,
div[class$="SectionContainer"] + div > a,
a[href^="/pressreleases/"] img {
background-color: #f7f8f7 !important;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we would change mix-blend-mode to all img elements I think this whole section could be removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried removing this section and it seems that some elements still need it.
Maybe we can remove all img elements from this section?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After removing some img elements there are issues, so this section seems to be needed!

div.shipping-textbox-header,
div[data-qa-element="SubscribeListContainer"] div:has(+ h4),
div[data-qa-element="SubscribeListContainer"] h4 strong {
div[data-qa-element="SubscribeListContainer"] h4 strong,

@Myshor Myshor Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again... adding specific paths for elements which work today can force make additional fixes in some days again.
If we have this container div[data-qa-element="SubscribeListMobileContainer"] problematic then maybe selector forcing color to all children would be better (still better if site will create some new approach to present text in different path inside.

Can you check div[data-qa-element="SubscribeListMobileContainer"] * instead of having this list growing?

Or maybe this will be outdated because we will set mix-blend-mode: normal for all images.

Comment thread src/config/dynamic-theme-fixes.config Outdated
div.house-brand-content-container div:is(.section-1, .section-2) {
background-image: none !important;
}
.parent-selector {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can not find any element with class .parent-selector on mentioned pages.
Can not confirm this part of fix is needed.

.parent-selector {
position: relative;
}
div:has(> div.quality-description) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can not find any div.quality-description on all sites I had opened today for tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

div[class^="scan-qr-login_qrCode"] svg *
div.shipping-textbox-subheader span
div.sc-social-media-list *
:is(section, div).footer-banner-container *

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what we want to fix here:

Image

Maybe you have some other example what this line will fix?

Comment thread src/config/dynamic-theme-fixes.config Outdated
position: relative;
z-index: 2;
}
.parent-selector {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is repeated?

And I already mentioned this for line R794
Can not find any element with class .parent-selector on mentioned pages.
Can not confirm this part of fix is needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove.

@arturstat

arturstat commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

In the mobile version:
https://secure.iherb.com/myaccount/subscription
we can replace:

div[data-qa-element="SubscribeListMobileContainer"]
  > div:first-of-type > div > div > div:first-of-type > div,
div[data-qa-element="SubscribeListMobileContainer"]
  > div:first-of-type > div > div > div:first-of-type > h2 strong {
    color: #2c7500 ! important;
}

with a single line:

div[data-qa-element="SubscribeListMobileContainer"]
  > div:first-of-type > div > div > div:first-of-type * {
    color: #2c7500 ! important;
}

I am using the full path because there are many random classes.

@arturstat

Copy link
Copy Markdown
Contributor Author

This is required:

div[data-qa-element="SubscribeListContainer"] div:has(+ h4),
div[data-qa-element="SubscribeListContainer"] h4 strong {
    color: #2c7500 ! important;
}

See the desktop version.
https://secure.iherb.com/myaccount/subscription

@arturstat

Copy link
Copy Markdown
Contributor Author

I think that after mix-blend-mode: normal on all images, the background section may be shortened.
I will have to investigate tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants