Skip to content
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: (CXSPA-9050) - Fix borders in high-contrast dark and light themes. #19789

Merged
merged 3 commits into from
Jan 9, 2025
Merged
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 @@ -65,6 +65,7 @@ export class SavedCartListComponent implements OnInit, OnDestroy {
) {
useFeatureStyles('a11ySavedCartsZoom');
useFeatureStyles('a11yQTY2Quantity');
useFeatureStyles('a11yHighContrastBorders');
}

ngOnInit(): void {
Expand Down
9 changes: 9 additions & 0 deletions feature-libs/cart/saved-cart/styles/_saved-cart-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ cx-saved-cart-list {
font-weight: $font-weight-normal;
}
}

@include cx-highContrastTheme {
@include forFeature('a11yHighContrastBorders') {
border-color: var(--cx-color-dark);
tr {
border-bottom-color: var(--cx-color-dark);
}
}
}
}

.cx-saved-cart-list-no-saved-carts {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ import {
CheckoutPaymentFacade,
CheckoutStepType,
} from '@spartacus/checkout/base/root';
import { PaymentDetails, TranslationService } from '@spartacus/core';
import {
PaymentDetails,
TranslationService,
useFeatureStyles,
} from '@spartacus/core';
import { billingAddressCard, paymentMethodCard } from '@spartacus/order/root';
import { Card, ICON_TYPE } from '@spartacus/storefront';
import { combineLatest, Observable } from 'rxjs';
import { Observable, combineLatest } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { CheckoutStepService } from '../../services/checkout-step.service';

Expand All @@ -32,7 +36,9 @@ export class CheckoutReviewPaymentComponent {
protected checkoutStepService: CheckoutStepService,
protected checkoutPaymentFacade: CheckoutPaymentFacade,
protected translationService: TranslationService
) {}
) {
useFeatureStyles('a11yHighContrastBorders');
}

paymentDetails$: Observable<PaymentDetails | undefined> =
this.checkoutPaymentFacade.getPaymentDetailsState().pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@
background-color: var(--cx-color-background);
.cx-review-summary-payment-card {
background-color: var(--cx-color-background);
@include forFeature('a11yHighContrastBorders') {
border-color: var(--cx-color-dark);
}
}
.cx-review-summary {
background-color: var(--cx-color-background);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
*/

import { Component } from '@angular/core';
import { RoutingService, TranslationService } from '@spartacus/core';
import {
RoutingService,
TranslationService,
useFeatureStyles,
} from '@spartacus/core';
import {
CustomerTicketingConfig,
CustomerTicketingFacade,
Expand All @@ -14,7 +18,7 @@ import {
TicketList,
} from '@spartacus/customer-ticketing/root';
import { ICON_TYPE } from '@spartacus/storefront';
import { combineLatest, Observable } from 'rxjs';
import { Observable, combineLatest } from 'rxjs';
import { map, tap } from 'rxjs/operators';

@Component({
Expand All @@ -27,7 +31,9 @@ export class CustomerTicketingListComponent {
protected routingService: RoutingService,
protected translationService: TranslationService,
protected customerTicketingConfig: CustomerTicketingConfig
) {}
) {
useFeatureStyles('a11yHighContrastBorders');
}
PAGE_SIZE =
this.customerTicketingConfig.customerTicketing?.listViewPageSize || 5;
sortType: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
}
}
}

@include cx-highContrastTheme {
@include forFeature('a11yHighContrastBorders') {
border-top-color: var(--cx-color-dark);
tr {
border-bottom-color: var(--cx-color-dark);
}
}
}
}

.cx-ticketing-list-thead-mobile {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,13 @@ export interface FeatureTogglesInterface {
*/
a11yHideConsentButtonWhenBannerVisible?: boolean;

/**
* Ensures that borders across all UI elements are visible and meet accessibility standards in high-contrast dark and light themes.
* This change is applied globally to enhance usability for users relying on high-contrast modes.
* Affects: CustomerTickingListComponent, CheckoutReviewPaymentComponent, SavedCartListComponent
*/
a11yHighContrastBorders?: boolean;

/**
* In OCC cart requests, it puts parameters of a cart name and cart description
* into a request body, instead of query params.
Expand Down Expand Up @@ -1078,6 +1085,7 @@ export const defaultFeatureToggles: Required<FeatureTogglesInterface> = {
a11yFocusOnCardAfterSelecting: false,
a11ySearchableDropdownFirstElementFocus: false,
a11yHideConsentButtonWhenBannerVisible: false,
a11yHighContrastBorders: false,
occCartNameAndDescriptionInHttpRequestBody: false,
cmsBottomHeaderSlotUsingFlexStyles: false,
useSiteThemeService: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ if (environment.cpq) {
a11yFocusOnCardAfterSelecting: true,
a11ySearchableDropdownFirstElementFocus: true,
a11yHideConsentButtonWhenBannerVisible: true,
a11yHighContrastBorders: true,
cmsBottomHeaderSlotUsingFlexStyles: true,
useSiteThemeService: true,
enableConsecutiveCharactersPasswordRequirement: true,
Expand Down
Loading