55 space ,
66 textSans14 ,
77 textSansBold15 ,
8- until ,
98} from '@guardian/source/foundations' ;
109import {
1110 Link ,
@@ -26,6 +25,7 @@ type Props = {
2625 url ?: string ;
2726 /** The ID of the edition, used to construct the Labs front URL */
2827 editionId : EditionId ;
28+ hasPageSkin : boolean ;
2929} ;
3030
3131const headerStyles = css `
@@ -36,6 +36,9 @@ const headerStyles = css`
3636 display : flex;
3737 flex-grow : 1 ;
3838 flex-direction : row;
39+ ` ;
40+
41+ const headerStylesFromLeftCol = css `
3942 ${ from . leftCol } {
4043 flex-direction : column;
4144 }
@@ -47,15 +50,22 @@ const logoStyles = css`
4750
4851const dividerStylesUntilLeftCol = css `
4952 position : relative;
50- ${ until . leftCol } {
51- margin-right : ${ space [ 4 ] } px;
53+ margin-right : ${ space [ 4 ] } px;
54+ ::after {
55+ content : '' ;
56+ position : absolute;
57+ top : 0 ;
58+ bottom : 0 ;
59+ right : -${ space [ 2 ] } px;
60+ border-right : 1px solid ${ schemePalette ( '--section-border' ) } ;
61+ }
62+ ` ;
63+
64+ const dividerStylesFromLeftCol = css `
65+ ${ from . leftCol } {
66+ margin-right : unset;
5267 ::after {
53- content : '' ;
54- position : absolute;
55- top : 0 ;
56- bottom : 0 ;
57- right : -${ space [ 2 ] } px;
58- border-right : 1px solid ${ schemePalette ( '--section-border' ) } ;
68+ display : none;
5969 }
6070 }
6171` ;
@@ -76,7 +86,9 @@ const labelAndAboutStyles = css`
7686 display : flex;
7787 flex-direction : row;
7888 justify-content : space-between;
89+ ` ;
7990
91+ const labelAndAboutStylesFromLeftCol = css `
8092 ${ between . leftCol . and . wide } {
8193 flex-direction : column;
8294 }
@@ -90,15 +102,17 @@ const labelStyles = css`
90102const aboutStyles = css `
91103 justify-self : end;
92104 ${ textSans14 }
105+ ` ;
93106
107+ const aboutStylesFromLeftCol = css `
94108 ${ between . leftCol . and . wide } {
95109 margin-top : ${ space [ 1 ] } px;
96110 }
97111` ;
98112
99- const positionStyles = css `
113+ const positionStyles = ( hasPageSkin : boolean ) => css `
100114 right : 0 ;
101- ${ from . leftCol } {
115+ ${ ! hasPageSkin && from . leftCol } {
102116 left : 0 ;
103117 right : auto;
104118 }
@@ -113,9 +127,20 @@ const detailsStyles = css`
113127 }
114128` ;
115129
116- export const LabsSectionHeader = ( { title, url, editionId } : Props ) => (
117- < div css = { headerStyles } >
118- < div css = { [ logoStyles , dividerStylesUntilLeftCol ] } >
130+ export const LabsSectionHeader = ( {
131+ title,
132+ url,
133+ editionId,
134+ hasPageSkin,
135+ } : Props ) => (
136+ < div css = { [ headerStyles , ! hasPageSkin && headerStylesFromLeftCol ] } >
137+ < div
138+ css = { [
139+ logoStyles ,
140+ dividerStylesUntilLeftCol ,
141+ ! hasPageSkin && dividerStylesFromLeftCol ,
142+ ] }
143+ >
119144 < Link
120145 href = { `https://www.theguardian.com/guardian-labs${ getLabsUrlSuffix (
121146 editionId ,
@@ -126,13 +151,20 @@ export const LabsSectionHeader = ({ title, url, editionId }: Props) => (
126151 </ div >
127152
128153 < div css = { textLayoutStyles } >
129- < div css = { labelAndAboutStyles } >
154+ < div
155+ css = { [
156+ labelAndAboutStyles ,
157+ ! hasPageSkin && labelAndAboutStylesFromLeftCol ,
158+ ] }
159+ >
130160 < span css = { labelStyles } > Paid content</ span >
131- < div css = { aboutStyles } >
161+ < div
162+ css = { [ aboutStyles , ! hasPageSkin && aboutStylesFromLeftCol ] }
163+ >
132164 < Details
133165 label = "About"
134166 labelSize = "xsmall"
135- positionStyles = { positionStyles }
167+ positionStyles = { positionStyles ( hasPageSkin ) }
136168 >
137169 < div css = { detailsStyles } >
138170 < p >
0 commit comments