@@ -14,14 +14,17 @@ import type {
1414} from '../types/front';
1515import type { TagPagePagination } from '../types/tagPage';
1616import { isAustralianTerritory, type Territory } from '../types/territory';
17+ import type { TrailType } from '../types/trails';
1718import { AustralianTerritorySwitcher } from './AustralianTerritorySwitcher.importable';
1819import { BrandingLabel } from './BrandingLabel';
1920import { ContainerOverrides } from './ContainerOverrides';
2021import { ContainerTitle } from './ContainerTitle';
2122import { FrontPagination } from './FrontPagination';
2223import { FrontSectionTitle } from './FrontSectionTitle';
24+ import { Hide } from './Hide';
2325import { Island } from './Island';
2426import { LabsSectionHeader } from './LabsSectionHeader';
27+ import { MostPopularFrontRight } from './MostPopularFrontRight';
2528import { ShowHideButton } from './ShowHideButton';
2629import { ShowMore } from './ShowMore.importable';
2730import { Treats } from './Treats';
@@ -90,6 +93,11 @@ type Props = {
9093 * the page skin background showing through the containers
9194 */
9295 hasPageSkin?: boolean;
96+ /**
97+ * The Slim Homepage AB test requires some sections to have reduced width so that
98+ * the Most Popular Front Right component can be placed on the right-hand side.
99+ */
100+ slimifySectionForAbTest?: boolean;
93101 discussionApiUrl: string;
94102 collectionBranding?: CollectionBranding;
95103 isTagPage?: boolean;
@@ -98,6 +106,8 @@ type Props = {
98106 isAboveMobileAd?: boolean;
99107 /** Indicates whether this is a Guardian Labs container */
100108 isLabs?: boolean;
109+ mostViewed?: TrailType[];
110+ deeplyRead?: TrailType[];
101111};
102112
103113const width = (columns: number, columnWidth: number, columnGap: number) =>
@@ -356,12 +366,17 @@ const sectionControls = css`
356366
357367const sectionContent = css`
358368 margin: 0;
369+ grid-column: content;
359370
360371 .hidden > & {
361372 display: none;
362373 }
374+ `;
363375
364- grid-column: content;
376+ const slimSectionContent = css`
377+ ${from.wide} {
378+ grid-column: 5 / 14;
379+ }
365380`;
366381
367382const sectionContentRow = (toggleable: boolean) => css`
@@ -385,7 +400,23 @@ const sectionContentBorderFromLeftCol = css`
385400 bottom: 0;
386401 border-left: 1px solid ${schemePalette('--section-border')};
387402 transform: translateX(-50%);
388- /** Keeps the vertical divider ontop of carousel item dividers */
403+ /** Keeps the vertical divider on top of carousel item dividers */
404+ z-index: 1;
405+ }
406+ }
407+ `;
408+
409+ const slimHomepageRightBorderStyles = css`
410+ ${from.wide} {
411+ ::after {
412+ content: '';
413+ position: absolute;
414+ top: ${space[2]}px;
415+ bottom: 0;
416+ right: 0;
417+ border-right: 1px solid ${schemePalette('--section-border')};
418+ transform: translateX(-50%);
419+ /** Keeps the vertical divider on top of carousel item dividers */
389420 z-index: 1;
390421 }
391422 }
@@ -619,13 +650,16 @@ export const FrontSection = ({
619650 isOnPaidContentFront,
620651 targetedTerritory,
621652 hasPageSkin = false,
653+ slimifySectionForAbTest = false,
622654 discussionApiUrl,
623655 collectionBranding,
624656 isTagPage = false,
625657 hasNavigationButtons = false,
626658 isAboveDesktopAd = false,
627659 isAboveMobileAd = false,
628660 isLabs = false,
661+ mostViewed = [],
662+ deeplyRead = [],
629663}: Props) => {
630664 const isToggleable = toggleable && !!sectionId;
631665 const showVerticalRule = !hasPageSkin;
@@ -690,6 +724,15 @@ export const FrontSection = ({
690724 title,
691725 showSectionColours,
692726 ),
727+ // To reduce the width of the border line between Features
728+ // and More features in the Slim Homepage AB test.
729+ slimifySectionForAbTest &&
730+ sectionId === 'more-features' &&
731+ css`
732+ ${from.wide} {
733+ grid-column: 2 / 14;
734+ }
735+ `,
693736 ]}
694737 />
695738 )}
@@ -784,18 +827,58 @@ export const FrontSection = ({
784827 <div
785828 css={[
786829 sectionContent,
830+ slimifySectionForAbTest && slimSectionContent,
787831 sectionContentHorizontalMargins,
788832 sectionContentRow(toggleable),
789833 topPadding,
790834 showVerticalRule &&
791835 isBetaContainer &&
792836 sectionContentBorderFromLeftCol,
837+ slimifySectionForAbTest &&
838+ slimHomepageRightBorderStyles,
793839 ]}
794840 id={`container-${sectionId}`}
795841 >
796842 {children}
797843 </div>
798844
845+ {slimifySectionForAbTest && sectionId === 'news' && (
846+ <div
847+ css={css`
848+ ${from.wide} {
849+ grid-row: content-toggleable;
850+ grid-column: 14 / 18;
851+ }
852+ `}
853+ >
854+ <Hide when="below" breakpoint="wide">
855+ <MostPopularFrontRight
856+ heading="Most viewed"
857+ trails={mostViewed}
858+ />
859+ </Hide>
860+ </div>
861+ )}
862+
863+ {slimifySectionForAbTest && sectionId === 'features' && (
864+ <div
865+ css={css`
866+ ${from.wide} {
867+ grid-row: content-toggleable;
868+ grid-column: 14 / 18;
869+ position: relative;
870+ }
871+ `}
872+ >
873+ <Hide when="below" breakpoint="wide">
874+ <MostPopularFrontRight
875+ heading="Deeply read"
876+ trails={deeplyRead}
877+ />
878+ </Hide>
879+ </div>
880+ )}
881+
799882 <div
800883 css={[
801884 sectionContentHorizontalMargins,
0 commit comments