1+ /* eslint-disable no-unused-vars */
12import { injectGlobal , css } from 'styled-components'
23import { transparentize , lighten } from 'polished'
34
@@ -14,9 +15,39 @@ injectGlobal`
1415`
1516/* eslint-enable no-unused-expressions */
1617
18+ const white = '#fff'
19+ const gray100 = '#f8f9fa'
20+ const gray200 = '#e9ecef'
21+ const gray300 = '#dee2e6'
22+ const gray400 = '#ced4da'
23+ const gray500 = '#adb5bd'
24+ const gray600 = '#6c757d'
25+ const gray700 = '#495057'
26+ const gray800 = '#343a40'
27+ const gray900 = '#212529'
28+ const black = '#000'
29+
30+ const blue = '#007bff'
31+ const indigo = '#6610f2'
32+ const purple = '#6f42c1'
33+ const pink = '#e83e8c'
34+ const red = '#dc3545'
35+ const orange = '#fd7e14'
36+ const yellow = '#ffc107'
37+ const green = '#28a745'
38+ const teal = '#20c997'
39+ const cyan = '#17a2b8'
40+
41+ const primary = blue
42+ const secondary = gray600
43+ const success = green
44+ const info = cyan
45+ const warning = yellow
46+ const danger = red
47+ const light = gray100
48+ const dark = gray800
49+
1750const primaryColor = '#bd4932'
18- const secondaryColor = '#063855'
19- const accentColor = '#46AFBD'
2051const grayLightColor = '#f6f6f6'
2152const grayDarkColor = '#aaa'
2253const grayDarkerColor = '#333'
@@ -25,9 +56,19 @@ export default {
2556 colors : {
2657 primary : primaryColor ,
2758 primaryLight : lighten ( 0.3 , primaryColor ) ,
28- secondary : secondaryColor ,
29- secondaryLight : '#E6EBEE' ,
30- accent : accentColor ,
59+ danger,
60+ success,
61+ white,
62+ gray100,
63+ gray200,
64+ gray300,
65+ gray400,
66+ gray500,
67+ gray600,
68+ gray700,
69+ gray800,
70+ gray900,
71+ black,
3172 grayLight : '#f6f6f6' ,
3273 gray : '#cfcfcf' ,
3374 grayDark : grayDarkColor ,
@@ -40,7 +81,6 @@ export default {
4081 disabledControlBg : grayLightColor ,
4182 disabledControlText : grayDarkColor ,
4283 placeholder : grayDarkColor ,
43- white : '#fff' ,
4484 } ,
4585 borderRadius : {
4686 sm : '.2rem' ,
@@ -72,19 +112,40 @@ export default {
72112 padding : 0.375rem 0.75rem ;
73113 font-size : 1rem ;
74114 line-height : 1.5 ;
75- color : # 495057 ;
76- background-color : # fff ;
115+ color : ${ props => props . theme . colors . gray700 } ;
116+ background-color : ${ props => props . theme . colors . white } ;
77117 background-clip : padding-box;
78- border : 1px solid # ced4da ;
118+ border : 1px solid ${ props => props . theme . colors . gray400 } ;
79119 border-radius : 0.25rem ;
80120 transition : border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
81121
82122 & : focus {
83- color : # 495057 ;
84- background-color : # fff ;
85- border-color : # 80bdff ;
123+ color : ${ props => props . theme . colors . gray700 } ;
124+ background-color : ${ props => props . theme . colors . white } ;
125+ border-color : ${ props => lighten ( 0.25 , props . theme . colors . primary ) } ;
86126 outline : 0 ;
87- box-shadow : 0 0 0 0.2rem rgba (0 , 123 , 255 , 0.25 );
127+ box-shadow : 0 0 0 0.2rem
128+ ${ props => transparentize ( 0.75 , props . theme . colors . primary ) } ;
129+ }
130+
131+ & .sui-is-valid {
132+ border-color : ${ props => props . theme . colors . success } ;
133+
134+ & : focus {
135+ border-color : ${ props => props . theme . colors . success } ;
136+ box-shadow : 0 0 0 0.2rem
137+ ${ props => transparentize ( 0.75 , props . theme . colors . success ) } ;
138+ }
139+ }
140+
141+ & .sui-is-invalid {
142+ border-color : ${ props => props . theme . colors . danger } ;
143+
144+ & : focus {
145+ border-color : ${ props => props . theme . colors . danger } ;
146+ box-shadow : 0 0 0 0.2rem
147+ ${ props => transparentize ( 0.75 , props . theme . colors . danger ) } ;
148+ }
88149 }
89150 }
90151 ` ,
0 commit comments