@@ -6,7 +6,7 @@ import Link from 'next/link'
66
77const URL = process . env . APP_URL
88
9- const style = css . global `
9+ const ButtonStyles = css . global `
1010 .button {
1111 display: inline-block;
1212 text-align: center;
@@ -100,7 +100,7 @@ const style = css.global`
100100 }
101101
102102 .button.submit {
103- background: ${ theme . colors . primaryLite } ;
103+ background-color : ${ theme . colors . primaryLite } ;
104104 }
105105
106106 .button.disabled {
@@ -159,7 +159,30 @@ export default function Button({
159159 value = 'value'
160160 >
161161 { children || value }
162- < style jsx > { style } </ style >
162+ < style jsx > { ButtonStyles } </ style >
163+ < style jsx > { `
164+ .button {
165+ box-shadow: ${ flat && 'none' } ;
166+ position: relative;
167+ }
168+ .button::after {
169+ content: '';
170+ position: absolute;
171+ top: 0;
172+ left: 0;
173+ width: 100%;
174+ height: 100%;
175+ mask: ${ useIcon
176+ ? `url(${ join ( URL , `/static/icon-${ useIcon } .svg` ) } )`
177+ : 'none' } ;
178+ mask-repeat: no-repeat;
179+ mask-position: center;
180+ z-index: 2;
181+ background-color: ${ useIcon
182+ ? theme . colors . primaryColor
183+ : 'initial' } ;
184+ }
185+ ` } </ style >
163186 </ button >
164187 )
165188 }
@@ -173,7 +196,30 @@ export default function Button({
173196 id = { id }
174197 >
175198 { children || value }
176- < style jsx > { style } </ style >
199+ < style jsx > { ButtonStyles } </ style >
200+ < style jsx > { `
201+ .button {
202+ box-shadow: ${ flat && 'none' } ;
203+ position: relative;
204+ }
205+ .button::after {
206+ content: '';
207+ position: absolute;
208+ top: 0;
209+ left: 0;
210+ width: 100%;
211+ height: 100%;
212+ mask: ${ useIcon
213+ ? `url(${ join ( URL , `/static/icon-${ useIcon } .svg` ) } )`
214+ : 'none' } ;
215+ mask-repeat: no-repeat;
216+ mask-position: center;
217+ z-index: 2;
218+ background-color: ${ useIcon
219+ ? theme . colors . primaryColor
220+ : 'initial' } ;
221+ }
222+ ` } </ style >
177223 </ Link >
178224 )
179225 }
@@ -185,15 +231,28 @@ export default function Button({
185231 disabled = { disabled }
186232 >
187233 { children }
188- < style jsx > { style } </ style >
234+ < style jsx > { ButtonStyles } </ style >
189235 < style jsx > { `
190236 .button {
191237 box-shadow: ${ flat && 'none' } ;
192- background-image: ${ useIcon
238+ position: relative;
239+ min-width: 1.75rem;
240+ min-height: 1.75rem;
241+ }
242+ .button::after {
243+ content: '';
244+ position: absolute;
245+ top: 0;
246+ left: 0;
247+ width: 100%;
248+ height: 100%;
249+ mask: ${ useIcon
193250 ? `url(${ join ( URL , `/static/icon-${ useIcon } .svg` ) } )`
194251 : 'none' } ;
195- min-height: ${ useIcon && '1.75rem' } ;
196- min-width: ${ useIcon && '1.75rem' } ;
252+ mask-repeat: no-repeat;
253+ mask-position: center;
254+ z-index: 2;
255+ background-color: ${ useIcon ? theme . colors . primaryColor : 'initial' } ;
197256 }
198257 ` } </ style >
199258 </ div >
0 commit comments