@@ -98,6 +98,40 @@ type Props = {
9898const width = ( columns : number , columnWidth : number , columnGap : number ) =>
9999 `width: ${ columns * columnWidth + ( columns - 1 ) * columnGap } px;` ;
100100
101+ const borderColourStyles = ( title ?: string ) : string => {
102+ switch ( title ) {
103+ case 'News' :
104+ return schemePalette ( '--section-border-news' ) ;
105+ case 'Opinion' :
106+ return schemePalette ( '--section-border-opinion' ) ;
107+ case 'Sport' :
108+ return schemePalette ( '--section-border-sport' ) ;
109+ case 'Lifestyle' :
110+ return schemePalette ( '--section-border-lifestyle' ) ;
111+ case 'Culture' :
112+ return schemePalette ( '--section-border-culture' ) ;
113+ default :
114+ return schemePalette ( '--section-border-primary' ) ;
115+ }
116+ } ;
117+
118+ const articleSectionTitleStyles = ( title ?: string ) : string => {
119+ switch ( title ) {
120+ case 'News' :
121+ return schemePalette ( '--article-section-title-news' ) ;
122+ case 'Opinion' :
123+ return schemePalette ( '--article-section-title-opinion' ) ;
124+ case 'Sport' :
125+ return schemePalette ( '--article-section-title-sport' ) ;
126+ case 'Lifestyle' :
127+ return schemePalette ( '--article-section-title-lifestyle' ) ;
128+ case 'Culture' :
129+ return schemePalette ( '--article-section-title-culture' ) ;
130+ default :
131+ return schemePalette ( '--article-section-title' ) ;
132+ }
133+ } ;
134+
101135/** Not all browsers support CSS grid, so we set explicit width as a fallback */
102136const fallbackStyles = css `
103137 @supports not (display : grid) {
@@ -401,10 +435,10 @@ const bottomPaddingBetaContainer = (
401435 }
402436` ;
403437
404- const primaryLevelTopBorder = css `
438+ const primaryLevelTopBorder = ( title ?: string ) => css `
405439 grid- row: 1;
406440 grid- column: 1 / -1;
407- bor der- to p: 2px solid ${ schemePalette ( '--section-border-primary' ) } ;
441+ bor der- to p: 2px solid ${ borderColourStyles ( title ) } ;
408442 /** Ensures the top border sits above the side borders */
409443 z- index: 1;
410444 height: fit- content;
@@ -590,7 +624,7 @@ export const FrontSection = ({
590624 css = { [
591625 containerLevel === 'Secondary'
592626 ? secondaryLevelTopBorder
593- : primaryLevelTopBorder ,
627+ : primaryLevelTopBorder ( title ) ,
594628 ] }
595629 />
596630 ) }
@@ -629,9 +663,7 @@ export const FrontSection = ({
629663 ? schemePalette (
630664 '--article-section-secondary-title' ,
631665 )
632- : schemePalette (
633- '--article-section-title' ,
634- )
666+ : articleSectionTitleStyles ( title )
635667 }
636668 // On paid fronts the title is not treated as a link
637669 url = { ! isOnPaidContentFront ? url : undefined }
0 commit comments