@@ -98,6 +98,40 @@ type Props = {
98
98
const width = ( columns : number , columnWidth : number , columnGap : number ) =>
99
99
`width: ${ columns * columnWidth + ( columns - 1 ) * columnGap } px;` ;
100
100
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
+
101
135
/** Not all browsers support CSS grid, so we set explicit width as a fallback */
102
136
const fallbackStyles = css `
103
137
@supports not (display : grid) {
@@ -404,21 +438,10 @@ const bottomPaddingBetaContainer = (
404
438
const primaryLevelTopBorder = ( title ?: string ) => css `
405
439
grid- row: 1;
406
440
grid- column: 1 / -1;
441
+ bor der- to p: 2px solid ${ borderColourStyles ( title ) } ;
407
442
/** Ensures the top border sits above the side borders */
408
443
z- index: 1;
409
444
height: fit- content;
410
-
411
- bor der- to p: 2px solid ${ schemePalette ( '--section-border-primary' ) } ;
412
- ${ title === 'News' &&
413
- `border-top: 2px solid ${ schemePalette ( '--section-border-news' ) } ;` }
414
- ${ title === 'Opinion' &&
415
- `border-top: 2px solid ${ schemePalette ( '--section-border-opinion' ) } ;` }
416
- ${ title === 'Sport' &&
417
- `border-top: 2px solid ${ schemePalette ( '--section-border-sport' ) } ;` }
418
- ${ title === 'Lifestyle' &&
419
- `border-top: 2px solid ${ schemePalette ( '--section-border-lifestyle' ) } ;` }
420
- ${ title === 'Culture' &&
421
- `border-top: 2px solid ${ schemePalette ( '--section-border-culture' ) } ;` }
422
445
` ;
423
446
424
447
const secondaryLevelTopBorder = css `
@@ -436,23 +459,6 @@ const carouselNavigationPlaceholder = css`
436
459
}
437
460
` ;
438
461
439
- const articleSectionTitleStyles = ( title ?: string ) : string => {
440
- switch ( title ) {
441
- case 'News' :
442
- return schemePalette ( '--article-section-title-news' ) ;
443
- case 'Opinion' :
444
- return schemePalette ( '--article-section-title-opinion' ) ;
445
- case 'Sport' :
446
- return schemePalette ( '--article-section-title-sport' ) ;
447
- case 'Lifestyle' :
448
- return schemePalette ( '--article-section-title-lifestyle' ) ;
449
- case 'Culture' :
450
- return schemePalette ( '--article-section-title-culture' ) ;
451
- default :
452
- return schemePalette ( '--article-section-title' ) ;
453
- }
454
- } ;
455
-
456
462
/**
457
463
* # Front Container
458
464
*
0 commit comments