Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,6 @@
>
</cx-media>
</div>
<button
#zoomButton
*ngIf="imageLoaded | async"
[attr.aria-label]="
isZoomed
? ('common.zoomOut' | cxTranslate)
: ('common.zoomIn' | cxTranslate)
"
title="{{
isZoomed
? ('common.zoomOut' | cxTranslate)
: ('common.zoomIn' | cxTranslate)
}}"
class="btn btn-link cx-zoom-btn"
(click)="zoom()"
>
<cx-icon
[type]="iconType.SEARCH_PLUS"
*ngIf="!isZoomed"
class="cx-zoom-indicator"
></cx-icon>
<cx-icon
[type]="iconType.SEARCH_MINUS"
*ngIf="isZoomed"
class="cx-zoom-indicator"
></cx-icon>
</button>
</div>
<ng-container *cxFeature="'!a11yKeyboardAccessibleZoom'">
<cx-media
Expand Down Expand Up @@ -92,6 +65,35 @@
</button>
</div>
</div>
<div class="cx-zoom-btn-container" *cxFeature="'a11yKeyboardAccessibleZoom'">
<button
#zoomButton
*ngIf="imageLoaded | async"
[attr.aria-label]="
isZoomed
? ('common.zoomOut' | cxTranslate)
: ('common.zoomIn' | cxTranslate)
"
title="{{
isZoomed
? ('common.zoomOut' | cxTranslate)
: ('common.zoomIn' | cxTranslate)
}}"
class="btn btn-link cx-zoom-btn"
(click)="zoom()"
>
<cx-icon
[type]="iconType.SEARCH_PLUS"
*ngIf="!isZoomed"
class="cx-zoom-indicator"
></cx-icon>
<cx-icon
[type]="iconType.SEARCH_MINUS"
*ngIf="isZoomed"
class="cx-zoom-indicator"
></cx-icon>
</button>
</div>
</ng-container>

<cx-product-image-zoom-thumbnails
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,41 +119,39 @@ cx-product-image-zoom-view {
@include media-breakpoint-up(lg) {
height: fit-content;
}
}

.cx-zoom-btn {
margin: 0.5rem;
border-radius: 100%;
background-color: var(--cx-color-medium);
position: absolute;
padding: 0;
right: 0;
bottom: 0;

@include media-breakpoint-down(sm) {
display: none;
}
.cx-zoom-btn-container {
text-align: center;
}

&:focus {
box-shadow: none;
}
.cx-zoom-btn {
margin: 0.5rem;
border-radius: 100%;
padding: 0;

.cx-zoom-indicator {
color: var(--cx-color-background-dark);
font-size: 2rem;
}
@include media-breakpoint-down(sm) {
display: none;
}

&:focus {
box-shadow: none;
}

.cx-zoom-indicator {
font-size: 2rem;
}
}
}

@include cx-highContrastTheme-light {
.cx-image-container .cx-zoom-btn .cx-zoom-indicator {
.cx-image-container .cx-zoom-btn-container .cx-zoom-btn .cx-zoom-indicator {
Copy link
Copy Markdown
Member

@BenjaminEmiliani BenjaminEmiliani Apr 13, 2026

Choose a reason for hiding this comment

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

by moving location of #zoomButton outside of the cx-image-container, this include chain and the below one are no longer aligned with the template

Copy link
Copy Markdown
Contributor Author

@Zeyber Zeyber Apr 14, 2026

Choose a reason for hiding this comment

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

I don't think they are chained because of the spaces between the classes. Or are you suggesting some clean up?

Copy link
Copy Markdown
Member

@BenjaminEmiliani BenjaminEmiliani Apr 14, 2026

Choose a reason for hiding this comment

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

The way scss interprets line 148 is equivalent to "find a .cx-zoom-indicator that lives inside .cx-zoom-btn inside .cx-zoom-btn-container inside .cx-image-container, and apply these styles to it."

You can even test it, change the color first (you should not see it changed for that theme when you select it in FE) Then remove cx-image-container you should now see the zoom icon change color when the theme is selected

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.

Ah, I think you might be referring to the styling changes of the zoom button. Sorry, yes this was an intentional change. No styling for this feature was provided by any official ux at the time so something was improvised. As the change was new (within the last year) and still behind the feature flag. I have changed it to be more consistent and easier to maintain.

In regards to breaking changes, we do not mind as its already behind a flag.

color: var(--cx-color-dark);
}
}

@include cx-highContrastTheme-dark {
.cx-image-container .cx-zoom-btn {
background-color: var(--cx-color-dark);
Copy link
Copy Markdown
Member

@BenjaminEmiliani BenjaminEmiliani Apr 13, 2026

Choose a reason for hiding this comment

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

Why remove the background color in this change? Could this be a breaking change for customer implementations using class cx-image-container for their own custom components?

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.

Both css changes are already encapsulated in the @include forFeature('a11yKeyboardAccessibleZoom'). So the breaking changes have been accounted for.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But shouldn't the breaking change be accounted for the default context where customer upgrades but feature flag comes in as false, and they keep it as such. So we want to preserve existing styling.

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.

Yes, it won't be affected if the customer does not enable the a11yKeyboardAccessibleZoom feature flag. We don't really mind too much if we change anything that is already behind this flag since we have to change many things rapidly in an a11y audit. For more complex features, we could consider nested or overriding flags for breaking changes related to breaking changes. But that is a lot of unnecessary tech debt and difficult to maintain for simple changes.

.cx-image-container .cx-zoom-btn-container .cx-zoom-btn .cx-zoom-indicator {
color: var(--cx-color-light);
--cx-color-visual-focus: #1f3a93;
}
Expand Down
Loading