11import React from "react"
2- import { rhythm } from "../utils/typography"
2+ import { rhythm , options } from "../utils/typography"
33import presets from "../utils/presets"
44import jsonp from "jsonp"
55import { validate } from "email-validator"
@@ -10,6 +10,23 @@ let stripeAnimation = css.keyframes({
1010 "100%" : { backgroundPosition : `30px 60px` } ,
1111} )
1212
13+ const formInputDefaultStyles = {
14+ backgroundColor : `#fff` ,
15+ border : `1px solid ${ presets . lightPurple } ` ,
16+ borderRadius : presets . radius ,
17+ color : presets . bodyColor ,
18+ fontFamily : options . headerFontFamily . join ( `,` ) ,
19+ padding : rhythm ( 1 / 2 ) ,
20+ verticalAlign : `middle` ,
21+ transition : `all ${ presets . animation . speedDefault } ${
22+ presets . animation . curveDefault
23+ } `,
24+ "::placeholder" : {
25+ color : presets . brandLight ,
26+ opacity : 1 ,
27+ } ,
28+ }
29+
1330// Mailchimp endpoint
1431// From: https://us17.admin.mailchimp.com/lists/integration/embeddedcode?id=XXXXXX
1532// Where `XXXXXX` is the MC list ID
@@ -117,27 +134,41 @@ class EmailCaptureForm extends React.Component {
117134118135 onChange = { this . _handleEmailChange }
119136 css = { {
120- padding : rhythm ( 1 / 2 ) ,
137+ ... formInputDefaultStyles ,
121138 width : `250px` ,
122- color : presets . bodyColor ,
139+ ":focus" : {
140+ color : presets . bodyColor ,
141+ borderColor : presets . brand ,
142+ outline : 0 ,
143+ boxShadow : `0 0 0 0.2rem rgba(${
144+ presets . shadowColor
145+ } , .25)`,
146+ } ,
123147 } }
124148 />
125149 < button
126150 type = "submit"
127151 onClick = { this . _handleFormSubmit }
128152 css = { {
129- borderRadius : `2px` ,
130- border : `1px solid ${ presets . brand } ` ,
153+ ...formInputDefaultStyles ,
154+ borderColor : presets . brand ,
155+ color : presets . brand ,
131156 cursor : `pointer` ,
132- padding : rhythm ( 1 / 2 ) ,
133- margin : ` ${ rhythm ( 1 / 2 ) } 0 0 ${ rhythm ( 1 / 2 ) } ` ,
134- ":hover" : {
157+ fontWeight : `bold` ,
158+ marginLeft : rhythm ( 1 / 2 ) ,
159+ ":hover, &:focus " : {
135160 backgroundSize : `30px 30px` ,
136161 backgroundColor : presets . brand ,
137162 backgroundImage : `linear-gradient(45deg, rgba(0,0,0, 0.1) 25%, transparent 25%, transparent 50%, rgba(0,0,0, 0.1) 50%, rgba(0,0,0, 0.1) 75%, transparent 75%, transparent)` ,
138163 color : `#fff` ,
139164 animation : `${ stripeAnimation } 2.8s linear infinite` ,
140165 } ,
166+ ":focus" : {
167+ outline : 0 ,
168+ boxShadow : `0 0 0 0.2rem rgba(${
169+ presets . shadowColor
170+ } ,.25)`,
171+ } ,
141172 } }
142173 >
143174 Subscribe
0 commit comments