Skip to content

Commit e5c8102

Browse files
authored
fix: (CXSPA-9574) - Widescreen layout improvements (#20066)
1 parent 659116f commit e5c8102

File tree

7 files changed

+50
-5
lines changed

7 files changed

+50
-5
lines changed

feature-libs/checkout/base/styles/components/order-confirmation/_order-confirmation-totals.scss

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
%cx-order-confirmation-totals {
22
.cx-order-summary {
33
padding-inline-end: var(--cx-padding, 0);
4+
@include forFeature('a11yWideScreenImprovements') {
5+
cx-order-summary {
6+
padding: 1rem;
7+
}
8+
}
49

510
&.container {
611
@include media-breakpoint-down(md) {

feature-libs/order/components/order-confirmation/order-confirmation-totals/order-confirmation-totals.component.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import { ChangeDetectionStrategy, Component, OnDestroy } from '@angular/core';
88
import { CartOutlets } from '@spartacus/cart/base/root';
9+
import { useFeatureStyles } from '@spartacus/core';
910
import { Order, OrderFacade } from '@spartacus/order/root';
1011
import { Observable } from 'rxjs';
1112

@@ -19,7 +20,9 @@ export class OrderConfirmationTotalsComponent implements OnDestroy {
1920
readonly cartOutlets = CartOutlets;
2021
order$: Observable<Order | undefined> = this.orderFacade.getOrderDetails();
2122

22-
constructor(protected orderFacade: OrderFacade) {}
23+
constructor(protected orderFacade: OrderFacade) {
24+
useFeatureStyles('a11yWideScreenImprovements');
25+
}
2326

2427
ngOnDestroy() {
2528
this.orderFacade.clearPlacedOrder();

feature-libs/product-configurator/rulebased/components/product-title/configurator-product-title.component.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
*/
66

77
import { ChangeDetectionStrategy, Component, HostBinding } from '@angular/core';
8-
import { Product, ProductScope, ProductService } from '@spartacus/core';
8+
import {
9+
Product,
10+
ProductScope,
11+
ProductService,
12+
useFeatureStyles,
13+
} from '@spartacus/core';
914
import {
1015
ConfiguratorRouter,
1116
ConfiguratorRouterExtractorService,
@@ -14,8 +19,8 @@ import { ICON_TYPE } from '@spartacus/storefront';
1419
import { EMPTY, Observable } from 'rxjs';
1520
import { map, switchMap, tap } from 'rxjs/operators';
1621
import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service';
17-
import { ConfiguratorExpertModeService } from '../../core/services/configurator-expert-mode.service';
1822
import { Configurator } from '../../core/model/configurator.model';
23+
import { ConfiguratorExpertModeService } from '../../core/services/configurator-expert-mode.service';
1924

2025
@Component({
2126
selector: 'cx-configurator-product-title',
@@ -80,7 +85,9 @@ export class ConfiguratorProductTitleComponent {
8085
protected configRouterExtractorService: ConfiguratorRouterExtractorService,
8186
protected productService: ProductService,
8287
protected configExpertModeService: ConfiguratorExpertModeService
83-
) {}
88+
) {
89+
useFeatureStyles('a11yWideScreenImprovements');
90+
}
8491

8592
triggerDetails(): void {
8693
this.showMore = !this.showMore;

feature-libs/product-configurator/rulebased/styles/_configurator-product-title.scss

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
%cx-configurator-product-title {
2+
@include forFeature('a11yWideScreenImprovements') {
3+
background-color: var(--cx-color-background);
4+
box-shadow: inset 0px 10px 7px -12px var(--cx-color-dark);
5+
}
26
&:not(:empty) {
37
@include media-breakpoint-up(lg) {
48
width: 1140px;
@@ -13,6 +17,10 @@
1317
flex-direction: row;
1418
justify-content: center;
1519
background-color: var(--cx-color-background);
20+
@include forFeature('a11yWideScreenImprovements') {
21+
background-color: unset;
22+
}
23+
1624
margin-block-end: 15px;
1725
}
1826

@@ -23,7 +31,12 @@
2331
padding-inline-end: 0px;
2432
padding-block-start: 15px;
2533
padding-block-end: 15px;
26-
box-shadow: inset 0px 10px 7px -12px var(--cx-color-dark);
34+
@include forFeature('a11yWideScreenImprovements') {
35+
box-shadow: unset;
36+
justify-content: center;
37+
max-width: 1140px;
38+
margin: auto;
39+
}
2740

2841
.cx-title {
2942
font-weight: bold;

projects/core/src/features-config/feature-toggles/config/feature-toggles.ts

+7
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,12 @@ export interface FeatureTogglesInterface {
962962
*/
963963
a11yWrapReviewOrderInSection?: boolean;
964964

965+
/**
966+
* Improves wide viewport layout issues.
967+
* Affects the styles of: Order confirmation page, product configurator.
968+
*/
969+
a11yWideScreenImprovements?: boolean;
970+
965971
/**
966972
* Adjusts line spacing in menus and navigation dropdowns for better readability
967973
* across different monitors, text sizes, and zoom levels.
@@ -1142,6 +1148,7 @@ export const defaultFeatureToggles: Required<FeatureTogglesInterface> = {
11421148
useExtendedMediaComponentConfiguration: false,
11431149
showRealTimeStockInPDP: false,
11441150
a11yScrollToTopPositioning: false,
1151+
a11yWideScreenImprovements: false,
11451152
a11yOptimizedMenuSpacing: false,
11461153
a11yNgSelectLayering: false,
11471154
enableSecurePasswordValidation: false,

projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts

+1
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ if (environment.cpq) {
440440
useExtendedMediaComponentConfiguration: true,
441441
showRealTimeStockInPDP: false,
442442
a11yScrollToTopPositioning: true,
443+
a11yWideScreenImprovements: true,
443444
a11yWrapReviewOrderInSection: true,
444445
a11yOptimizedMenuSpacing: true,
445446
a11yNgSelectLayering: true,

projects/storefrontstyles/scss/layout/page-templates/_order-confirmation-page.scss

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
margin-inline-start: auto;
88
margin-inline-end: auto;
99

10+
@include forFeature('a11yWideScreenImprovements') {
11+
@include media-breakpoint-up(xl) {
12+
flex: none;
13+
width: var(--cx-page-width-max);
14+
margin-inline-start: 100%;
15+
margin-inline-end: 100%;
16+
}
17+
}
18+
1019
@include media-breakpoint-down(md) {
1120
width: 100%;
1221
max-width: none;

0 commit comments

Comments
 (0)