Update dynamic theme fixes for hugoboss.com - #15935
Conversation
| 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;"] |
There was a problem hiding this comment.
| 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;"] |
There was a problem hiding this comment.
| 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 { |
There was a problem hiding this comment.
Area below the slider:
https://www.hugoboss.com/pt/en/all-brands/men/highlights/inspiration/styleinspotlight/
| 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), |
There was a problem hiding this comment.
"Shop now" text over white images:
https://www.hugoboss.com/pt/en/boss-women-jeans-fit-guide/
| 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), |
There was a problem hiding this comment.
Text over white images:
https://www.hugoboss.com/pt/en/boss-women-jeans-fit-guide/
| 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;"], |
There was a problem hiding this comment.
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;"] *, |
There was a problem hiding this comment.
Force text color for all elements inside the div:
https://www.hugoboss.com/fr/toutes-les-marques/homme/stories/inspirations/boss-zone/?prefn1=brand&prefv1=BOSS
| footer div.dch-footer__item-payments div.dch-icon-svg { | ||
| fill: #000000 !important; | ||
| } | ||
| @media only screen and (min-width: 47rem) { |
There was a problem hiding this comment.
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/
There was a problem hiding this comment.
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:
- 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
#000000will cause a complete loss of contrast (black text on dark images). - 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. - Background-Agnostic Solution: Contrast issues over image banners should be solved without toggling font colors between breakpoints. Applying
text-shadowon 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;
}There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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/
There was a problem hiding this comment.
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 * |
There was a problem hiding this comment.
Text over the shoe image:
https://www.hugoboss.com/pt/en/boss-guides/
There was a problem hiding this comment.
If your suggestion above is used, this line can be deleted.
Myshor
left a comment
There was a problem hiding this comment.
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:
-
Re-audit forced black text colors:
Go through every instance wherecolor: #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 liketext-shadowrather than hardcoded font colors. -
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. -
Eliminate media query bloat & overfitted selector chains:
Replace the@mediablocks 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), |
| 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), |
| } | ||
| 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, |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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:
- 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
#000000will cause a complete loss of contrast (black text on dark images). - 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. - Background-Agnostic Solution: Contrast issues over image banners should be solved without toggling font colors between breakpoints. Applying
text-shadowon 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) { |
There was a problem hiding this comment.
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.




https://www.hugoboss.com/pt/en/home