Skip to content

Update dynamic theme fixes for hugoboss.com - #15935

Open
arturstat wants to merge 1 commit into
darkreader:mainfrom
arturstat:patch-351793
Open

Update dynamic theme fixes for hugoboss.com#15935
arturstat wants to merge 1 commit into
darkreader:mainfrom
arturstat:patch-351793

Conversation

@arturstat

Copy link
Copy Markdown
Contributor

@arturstat
arturstat marked this pull request as draft August 28, 2026 03:04
div.sidebar svg.bottom-sheet__close-svg
div#main svg.care-info__icon
div#main div.dch-icon svg
div#main div:not(:has(div[style^="background-color: rgb(237, 237, 237) !important;"]))[style^="background-color: rgb(237, 237, 237) !important;"]

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#main div:not(:has(a[style^="background-color: rgb(255, 255, 255) !important;"]))[style^="background-color: rgb(255, 255, 255) !important;"]
div#main section[style^="background-color: rgb(255, 255, 255) !important;"]
div#main section[style^="background-color: rgb(255, 255, 255) !important;"] button.dch-topbanner__play_button svg
div#main div[style^="background-color: white !important;"]

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#main div.dch-head-teaser__container:has(> div.dch-head-teaser__image-area img[alt="Find your inspiration"]) div.dch-head-teaser__text-container,
div#main a:has(div[style^="background-color: !important;"]) div.dch-head-teaser__text-container,
div#main a:has(div[style^="background-color: !important;"]) p.dch-links-item:not(.dch-links-item--button-bordered--white-large) span,
div#main div.dch-home-hub-slider-2__dots div.swiper-dot div.dch-home-hub-slider-2__dots-buttons 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.

div#main div.dch-home-hub-slider-2__dots div.swiper-dot div.dch-home-hub-slider-2__dots-buttons button {
background-color: #ffffff !important;
}
div#main section.dch-component a.dch-links-item:has(img) p.dch-links-item--button-bordered:not(.dch-links-item--button-bordered--white-small),

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.

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 you are fixing here.
Without this PR merged I see all "Shop now" black on white.

Image

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 desktop version is alright.
This is what I get in the mobile version after deleting this line:

Image

background-color: #ffffff !important;
}
div#main section.dch-component a.dch-links-item:has(img) p.dch-links-item--button-bordered:not(.dch-links-item--button-bordered--white-small),
div#main section.dch-component a.dch-links-item:has(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.

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.

Same as above. I do not know which text

Image

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 is what I get in the mobile version after deleting this line:

Image

div#main section.dch-component a.dch-links-item:has(img) p.dch-links-item--button-bordered:not(.dch-links-item--button-bordered--white-small),
div#main section.dch-component a.dch-links-item:has(img),
:is(div.main-header__main, div#main) a.dch-links-item:not(.dch-core--invert) div.dch-core__font__copy,
div#main div[style^="background-color: rgb(237, 237, 237) !important;"],

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.

Force text color inside white area in order to invert the whole area later:
https://www.hugoboss.com/fr/toutes-les-marques/homme/stories/inspirations/boss-zone/?prefn1=brand&prefv1=BOSS

div#main section.dch-component a.dch-links-item:has(img),
:is(div.main-header__main, div#main) a.dch-links-item:not(.dch-core--invert) div.dch-core__font__copy,
div#main div[style^="background-color: rgb(237, 237, 237) !important;"],
div#main div[style^="background-color: rgb(237, 237, 237) !important;"] *,

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.

footer div.dch-footer__item-payments div.dch-icon-svg {
fill: #000000 !important;
}
@media only screen and (min-width: 47rem) {

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 purpose of the code from line 17861 to 17877 is to define black color on text that lies over images that are white or nearly white for improved visibility. Because the image area occupied by the text differs between mobile and desktop versions, different handling is required. After these fixes, text over images should be readable in the desktop version of the following pages:
https://www.hugoboss.com/pt/en/home
https://www.hugoboss.com/pt/en/inspiration/
https://www.hugoboss.com/pt/en/all-brands/men/highlights/inspiration/beckham-x-boss-campaign/
https://www.hugoboss.com/pt/en/be-your-own-boss/
https://www.hugoboss.com/pt/en/all-brands/men/highlights/inspiration/boss-x-aston-martin/
https://www.hugoboss.com/pt/en/all-brands/men/highlights/inspiration/boss-performance/
https://www.hugoboss.com/pt/en/all-brands/men/highlights/inspiration/styleinspotlight/
https://www.hugoboss.com/pt/en/all-brands/men/highlights/inspiration/boss-zone/
https://www.hugoboss.com/pt/en/all-brands/men/highlights/inspiration/women-inspiration-sports/
https://www.hugoboss.com/pt/en/boss-brandlines-men/
https://www.hugoboss.com/pt/en/all-brands/men/highlights/inspiration/boss-x-ligne-roset/
https://www.hugoboss.com/pt/en/boss-men-we-care/
https://www.hugoboss.com/pt/en/all-brands/women/highlights/office-wear-for-women/
https://www.hugoboss.com/pt/en/boss-women-jeans-fit-guide/
https://www.hugoboss.com/pt/en/boss-men-made-to-measure/
https://www.hugoboss.com/pt/en/boss-quality/
https://www.hugoboss.com/pt/en/boss-guides/
https://www.hugoboss.com/pt/en/boss-men-12-rules-of-suits/
https://www.hugoboss.com/pt/en/boss-watches-jewellery-collection/
https://www.hugoboss.com/pt/en/boss-eyewear/
https://www.hugoboss.com/pt/en/hugo-men/
https://www.hugoboss.com/pt/en/hugo-women/
https://www.hugoboss.com/pt/en/boss-experience/
https://www.hugoboss.com/pt/en/boss-camel-men/
https://www.hugoboss.com/pt/en/brandline-boss-black/
https://www.hugoboss.com/pt/en/boss-green-men/
https://www.hugoboss.com/pt/en/boss-men-orange/
https://www.hugoboss.com/pt/en/boss-black-women/
https://www.hugoboss.com/pt/en/boss-orange-women/
https://www.hugoboss.com/pt/en/gift-ideas/

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.

Hardcoding color: #000000 !important inside @media (min-width: 47rem) based on the assumption that hero images are currently white/bright is a severe regression risk:

  1. Dynamic Content Fragility: Hugo Boss rotates hero banners frequently across seasons and marketing campaigns. The moment a dark or nighttime campaign image is deployed in these containers, forcing #000000 will cause a complete loss of contrast (black text on dark images).
  2. Overfitting: Relying on 30+ campaign URLs and 10-level chained pseudo-selectors (:has(img):not(:has(> a)), :not(.dch-core__font-invert--large)) is unmaintainable. Any minor upstream DOM/BEM update will silently break these rules and leave dead CSS payload in the config.
  3. Background-Agnostic Solution: Contrast issues over image banners should be solved without toggling font colors between breakpoints. Applying text-shadow on the base teaser/headline components ensures high contrast across both light and dark images, on desktop and mobile alike:
.dch-head-teaser h1,
.dch-head-teaser .dch-links-item,
.dch-home-hub-stage-2__headline,
.dch-home-hub-stage-2__subline {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9) !important;
}

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 tested this suggestion, and I can see that it seems an excellent idea!
I will see what I can do with your suggestion.

fill: #000000 !important;
}
}
@media only screen and (max-width: 47rem) {

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 purpose of lines 17878 to 17883 is to define black text over bright images for improved visibility. The code deals with small screens such as the ones in mobile devices, by restoring the original text color. Text over images in the mobile version of the pages mentioned in the previous comment and particularly in following pages should be readable:
https://www.hugoboss.com/pt/en/all-brands/men/highlights/inspiration/boss-x-ligne-roset/
https://www.hugoboss.com/pt/en/boss-men-12-rules-of-suits/
https://www.hugoboss.com/pt/en/gift-ideas/

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.

Same issue here. Splitting text color rules into a separate @media (max-width: 47rem) block is completely redundant if we handle text legibility via text-shadow on the base classes rather than overriding font colors per breakpoint.

IGNORE INLINE STYLE
:is(header, div#main) section.dch-topbanner button.dch-topbanner__play_button *
div#main button.dch-links-item--play span.dch-links-item__icon *
div#main section.dch-component a.dch-links-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.

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.

If your suggestion above is used, this line can be deleted.

@arturstat
arturstat marked this pull request as ready for review August 28, 2026 04:52

@Myshor Myshor left a comment

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.

Summary of Changes Requested

This PR introduces excessive specificity and overfitted media queries that significantly increase maintenance overhead and config bloat.

Please address the following points before this can be considered:

  1. Re-audit forced black text colors:
    Go through every instance where color: #000000 !important; is being forced and verify if it is genuinely necessary. While certain edge cases occasionally require a hard override, contrast issues over image containers should default to generic, background-agnostic solutions like text-shadow rather than hardcoded font colors.

  2. Preventing recurring regressions and review cycles:
    Hardcoding micro-fixes for 30+ seasonal marketing URLs creates a fragile setup. Every time upstream rotates banners or changes a CSS class, these rules break, leading to repeated PRs for the exact same domain every few weeks and wasting reviewer bandwidth. The configuration should be resilient to marketing updates, not tied to current campaign assets.

  3. Eliminate media query bloat & overfitted selector chains:
    Replace the @media blocks and deep pseudo-selector chains (:has(), :not()) with clean, component-level rules that work across all viewports.

Please refactor the changes to keep the configuration clean, minimal, and maintainable long-term.

div#main div.dch-home-hub-slider-2__dots div.swiper-dot div.dch-home-hub-slider-2__dots-buttons button {
background-color: #ffffff !important;
}
div#main section.dch-component a.dch-links-item:has(img) p.dch-links-item--button-bordered:not(.dch-links-item--button-bordered--white-small),

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 you are fixing here.
Without this PR merged I see all "Shop now" black on white.

Image

background-color: #ffffff !important;
}
div#main section.dch-component a.dch-links-item:has(img) p.dch-links-item--button-bordered:not(.dch-links-item--button-bordered--white-small),
div#main section.dch-component a.dch-links-item:has(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.

Same as above. I do not know which text

Image

}
div#main section.dch-component a.dch-links-item:has(img) p.dch-links-item--button-bordered:not(.dch-links-item--button-bordered--white-small),
div#main section.dch-component a.dch-links-item:has(img),
:is(div.main-header__main, div#main) a.dch-links-item:not(.dch-core--invert) div.dch-core__font__copy,

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.

Screens!!! I can not confirm on my side. With old sitesfixes.

footer div.dch-footer__item-payments div.dch-icon-svg {
fill: #000000 !important;
}
@media only screen and (min-width: 47rem) {

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.

Hardcoding color: #000000 !important inside @media (min-width: 47rem) based on the assumption that hero images are currently white/bright is a severe regression risk:

  1. Dynamic Content Fragility: Hugo Boss rotates hero banners frequently across seasons and marketing campaigns. The moment a dark or nighttime campaign image is deployed in these containers, forcing #000000 will cause a complete loss of contrast (black text on dark images).
  2. Overfitting: Relying on 30+ campaign URLs and 10-level chained pseudo-selectors (:has(img):not(:has(> a)), :not(.dch-core__font-invert--large)) is unmaintainable. Any minor upstream DOM/BEM update will silently break these rules and leave dead CSS payload in the config.
  3. Background-Agnostic Solution: Contrast issues over image banners should be solved without toggling font colors between breakpoints. Applying text-shadow on the base teaser/headline components ensures high contrast across both light and dark images, on desktop and mobile alike:
.dch-head-teaser h1,
.dch-head-teaser .dch-links-item,
.dch-home-hub-stage-2__headline,
.dch-home-hub-stage-2__subline {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9) !important;
}

fill: #000000 !important;
}
}
@media only screen and (max-width: 47rem) {

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.

Same issue here. Splitting text color rules into a separate @media (max-width: 47rem) block is completely redundant if we handle text legibility via text-shadow on the base classes rather than overriding font colors per breakpoint.

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