44 headlineMedium20 ,
55 space ,
66 textSans14 ,
7- textSans15 ,
7+ textSansBold15 ,
88} from '@guardian/source/foundations' ;
99import { SvgNewsletterFilled } from '@guardian/source/react-components' ;
1010import { palette as themePalette } from '../palette' ;
@@ -22,7 +22,7 @@ export type NewsletterSignupCardProps = {
2222const containerStyles = css `
2323 clear : left;
2424 background-color : ${ themePalette ( '--newsletter-card-background' ) } ;
25- padding : ${ space [ 3 ] } px ${ space [ 3 ] } px ${ space [ 4 ] } px ${ space [ 3 ] } px;
25+ padding : ${ space [ 2 ] } px ${ space [ 3 ] } px ${ space [ 4 ] } px ${ space [ 3 ] } px;
2626` ;
2727
2828const dividerStyles = css `
@@ -55,34 +55,64 @@ const titleStyles = css`
5555const frequencyTagStyles = css `
5656 dis play: flex;
5757 align- items: center;
58+ gap: 6px;
5859 color : ${ themePalette ( '--newsletter-card-frequency-tag' ) } ;
59- ${ textSans15 } ;
60- margin- left: -1px;
61- margin- to p: -1px;
62- margin- botto m: ${ space [ 1 ] } px;
60+ ${ textSansBold15 } ;
61+ margin- botto m: ${ space [ 2 ] } px;
62+ ` ;
63+
64+ const frequencyTextStyles = css `
65+ dis play: flex;
66+ flex- wrap: wrap;
67+ column- gap: ${ space [ 1 ] } px;
68+ ` ;
69+
70+ const frequencyLabelStyles = css `
71+ white-space: nowrap;
72+ ` ;
73+
74+ const badgeStyles = css `
75+ dis play: flex;
76+ align- items: center;
77+ justify- content: center;
78+ flex- shrink: 0;
79+ width: 24px;
80+ height: 24px;
81+ bor der- radius: 50%;
82+ background- color : ${ themePalette ( '--newsletter-card-badge-background' ) } ;
6383
6484 svg {
65- fill: currentCol or ;
66- height: 20px ;
67- width: 20px ;
85+ fill: ${ themePalette ( '--newsletter-card-badge-icon' ) } ;
86+ height: 18px ;
87+ width: 18px ;
6888 }
6989` ;
7090
91+ const innerDividerStyles = css `
92+ bor der: none;
93+ bor der- to p: 1px solid ${ themePalette ( '--newsletter-card-divider' ) } ;
94+ margin: 0 - ${ space [ 3 ] } px ${ space [ 2 ] } px;
95+ ` ;
96+
7197const descriptionStyles = css `
7298 ${ textSans14 } ;
7399 line-height: 1.15;
74- margin- botto m: ${ space [ 2 ] } px;
75100 clear: both;
76101 color : ${ themePalette ( '--newsletter-card-description' ) } ;
77102` ;
78103
79104const illustrationStyles = css `
80105 flex- shrink: 0;
81- width: 90px ;
82- height: 90px ;
106+ width: 70px ;
107+ height: 70px ;
83108 bor der- radius: 50%;
84109 object- fit: cover;
85110
111+ ${ from . mobileMedium } {
112+ width: 90px;
113+ height: 90px;
114+ }
115+
86116 ${ from . tablet } {
87117 width: 100px;
88118 height: 100px;
@@ -92,27 +122,35 @@ const illustrationStyles = css`
92122const NewsletterSignupHeader = (
93123 props : Omit < NewsletterSignupCardProps , 'children' > ,
94124) => (
95- < div css = { headerStyles } >
96- < div css = { titleAndMetaStyles } >
97- < div css = { frequencyTagStyles } >
125+ < >
126+ < div css = { frequencyTagStyles } >
127+ < span css = { badgeStyles } >
98128 < SvgNewsletterFilled />
99- Free newsletter | { props . frequency }
129+ </ span >
130+ < span css = { frequencyTextStyles } >
131+ < span css = { frequencyLabelStyles } > Free newsletter |</ span >
132+ < span css = { frequencyLabelStyles } > { props . frequency } </ span >
133+ </ span >
134+ </ div >
135+ < hr css = { innerDividerStyles } />
136+ < div css = { headerStyles } >
137+ < div css = { titleAndMetaStyles } >
138+ < p css = { titleStyles } >
139+ Sign up to < span > { props . name } </ span >
140+ </ p >
141+ < p css = { descriptionStyles } > { props . description } </ p >
100142 </ div >
101- < p css = { titleStyles } >
102- Sign up to < span > { props . name } </ span >
103- </ p >
104- < p css = { descriptionStyles } > { props . description } </ p >
143+ { ! ! props . illustrationSquare && (
144+ < img
145+ css = { illustrationStyles }
146+ src = { props . illustrationSquare }
147+ alt = ""
148+ loading = "lazy"
149+ decoding = "async"
150+ />
151+ ) }
105152 </ div >
106- { ! ! props . illustrationSquare && (
107- < img
108- css = { illustrationStyles }
109- src = { props . illustrationSquare }
110- alt = ""
111- loading = "lazy"
112- decoding = "async"
113- />
114- ) }
115- </ div >
153+ </ >
116154) ;
117155
118156export const NewsletterSignupCard = ( {
0 commit comments