1
1
import { recipe } from "@vanilla-extract/recipes" ;
2
- import { createTheme } from "@vanilla-extract/css" ;
3
- import { ButtonTheme } from "./button.types" ;
4
2
5
- export const [ defaultButtonTheme , defaultButtonVars ] : ButtonTheme = createTheme (
6
- {
7
- color : "#FFFFFF" ,
8
- backgroundColor : "#1AB5EB" ,
9
- borderColor : "none" ,
10
- hoverBackgroundColor : "#008FCB" ,
11
- hoverColor : "#FFFFFF" ,
12
- hoverBorderColor : "none" ,
13
- focusBackgroundColor : "#1AB5EB40" ,
14
- focusColor : "#FFFFFF" ,
15
- focusBorderColor : "#C6EDFB" ,
16
- disabledBackgroundColor : "#8CDAF5" ,
17
- disabledColor : "#FFFFFF" ,
18
- disabledBorderColor : "none" ,
19
- }
20
- ) ;
21
-
22
- export const [ lightButtonTheme , lightButtonVars ] : ButtonTheme = createTheme ( {
23
- color : "#1AB5EB" ,
24
- backgroundColor : "#F9F9F9" ,
25
- borderColor : "#DDDDDD" ,
26
- hoverBackgroundColor : "#F0F0F0" ,
27
- hoverColor : "#008FCB" ,
28
- hoverBorderColor : "none" ,
29
- focusBackgroundColor : "#F9F9F9" ,
30
- focusColor : "#1AB5EB" ,
31
- focusBorderColor : "#C6EDFB" ,
32
- disabledBackgroundColor : "#F9F9F9" ,
33
- disabledColor : "#1AB5EB" ,
34
- disabledBorderColor : "#DDDDDD" ,
35
- } ) ;
36
-
37
- export const [ ghostButtonTheme , ghostButtonVars ] : ButtonTheme = createTheme ( {
38
- color : "#1AB5EB" ,
39
- backgroundColor : "none" ,
40
- borderColor : "none" ,
41
- hoverBackgroundColor : "#0000000D" ,
42
- hoverColor : "#008FCB" ,
43
- hoverBorderColor : "none" ,
44
- focusBackgroundColor : "none" ,
45
- focusColor : "#1AB5EB" ,
46
- focusBorderColor : "#C6EDFB" ,
47
- disabledBackgroundColor : "none" ,
48
- disabledColor : "#1AB5EB" ,
49
- disabledBorderColor : "" ,
50
- } ) ;
51
-
52
- export const [ hallowButtonTheme , hallowButtonVars ] : ButtonTheme = createTheme ( {
53
- color : "#1AB5EB" ,
54
- backgroundColor : "none" ,
55
- borderColor : "#1AB5EB" ,
56
- hoverBackgroundColor : "none" ,
57
- hoverColor : "#1AB5EB" ,
58
- hoverBorderColor : "#AAAAAA" ,
59
- focusBackgroundColor : "none" ,
60
- focusColor : "#101010" ,
61
- focusBorderColor : "#C6EDFB" ,
62
- disabledBackgroundColor : "none" ,
63
- disabledColor : "#878787" ,
64
- disabledBorderColor : "#EEEEEE" ,
65
- } ) ;
3
+ import { defaultVars , lightVars , ghostVars , hallowVars } from "src/themes" ;
66
4
67
5
export const buttonStyles = recipe ( {
68
6
base : {
@@ -74,90 +12,90 @@ export const buttonStyles = recipe({
74
12
variants : {
75
13
variant : {
76
14
default : {
77
- background : defaultButtonVars . backgroundColor ,
78
- color : defaultButtonVars . color ,
79
- borderColor : defaultButtonVars . borderColor ,
15
+ background : defaultVars . backgroundColor ,
16
+ color : defaultVars . color ,
17
+ borderColor : defaultVars . borderColor ,
80
18
border : 0 ,
81
19
":hover" : {
82
- background : defaultButtonVars . hoverBackgroundColor ,
83
- color : defaultButtonVars . hoverColor ,
84
- borderColor : defaultButtonVars . hoverBorderColor ,
20
+ background : defaultVars . hoverBackgroundColor ,
21
+ color : defaultVars . hoverColor ,
22
+ borderColor : defaultVars . hoverBorderColor ,
85
23
} ,
86
24
":focus" : {
87
25
borderWidth : "2px" ,
88
- background : defaultButtonVars . focusBackgroundColor ,
89
- color : defaultButtonVars . focusColor ,
90
- borderColor : defaultButtonVars . focusBorderColor ,
26
+ background : defaultVars . focusBackgroundColor ,
27
+ color : defaultVars . focusColor ,
28
+ borderColor : defaultVars . focusBorderColor ,
91
29
} ,
92
30
":disabled" : {
93
- background : defaultButtonVars . disabledBackgroundColor ,
94
- color : defaultButtonVars . disabledColor ,
95
- borderColor : defaultButtonVars . disabledBorderColor ,
31
+ background : defaultVars . disabledBackgroundColor ,
32
+ color : defaultVars . disabledColor ,
33
+ borderColor : defaultVars . disabledBorderColor ,
96
34
} ,
97
35
} ,
98
36
light : {
99
- background : lightButtonVars . backgroundColor ,
100
- color : lightButtonVars . color ,
37
+ background : lightVars . backgroundColor ,
38
+ color : lightVars . color ,
101
39
border : "1px solid" ,
102
- borderColor : lightButtonVars . borderColor ,
40
+ borderColor : lightVars . borderColor ,
103
41
":hover" : {
104
- background : lightButtonVars . hoverBackgroundColor ,
105
- color : lightButtonVars . hoverColor ,
106
- borderColor : lightButtonVars . hoverBorderColor ,
42
+ background : lightVars . hoverBackgroundColor ,
43
+ color : lightVars . hoverColor ,
44
+ borderColor : lightVars . hoverBorderColor ,
107
45
} ,
108
46
":focus" : {
109
47
borderWidth : "2px" ,
110
- background : lightButtonVars . focusBackgroundColor ,
111
- color : lightButtonVars . focusColor ,
112
- borderColor : lightButtonVars . focusBorderColor ,
48
+ background : lightVars . focusBackgroundColor ,
49
+ color : lightVars . focusColor ,
50
+ borderColor : lightVars . focusBorderColor ,
113
51
} ,
114
52
":disabled" : {
115
- background : lightButtonVars . disabledBackgroundColor ,
116
- color : lightButtonVars . disabledColor ,
117
- borderColor : lightButtonVars . disabledBorderColor ,
53
+ background : lightVars . disabledBackgroundColor ,
54
+ color : lightVars . disabledColor ,
55
+ borderColor : lightVars . disabledBorderColor ,
118
56
} ,
119
57
} ,
120
58
ghost : {
121
- background : ghostButtonVars . backgroundColor ,
59
+ background : ghostVars . backgroundColor ,
122
60
border : 0 ,
123
- color : ghostButtonVars . color ,
61
+ color : ghostVars . color ,
124
62
":hover" : {
125
- background : ghostButtonVars . hoverBackgroundColor ,
126
- color : ghostButtonVars . hoverColor ,
127
- borderColor : ghostButtonVars . hoverBorderColor ,
63
+ background : ghostVars . hoverBackgroundColor ,
64
+ color : ghostVars . hoverColor ,
65
+ borderColor : ghostVars . hoverBorderColor ,
128
66
} ,
129
67
":focus" : {
130
68
borderWidth : "2px" ,
131
- background : ghostButtonVars . focusBackgroundColor ,
132
- color : ghostButtonVars . focusColor ,
133
- borderColor : ghostButtonVars . focusBorderColor ,
69
+ background : ghostVars . focusBackgroundColor ,
70
+ color : ghostVars . focusColor ,
71
+ borderColor : ghostVars . focusBorderColor ,
134
72
} ,
135
73
":disabled" : {
136
- background : ghostButtonVars . disabledBackgroundColor ,
137
- color : ghostButtonVars . disabledColor ,
138
- borderColor : ghostButtonVars . disabledBorderColor ,
74
+ background : ghostVars . disabledBackgroundColor ,
75
+ color : ghostVars . disabledColor ,
76
+ borderColor : ghostVars . disabledBorderColor ,
139
77
} ,
140
78
} ,
141
79
hallow : {
142
- background : hallowButtonVars . backgroundColor ,
80
+ background : hallowVars . backgroundColor ,
143
81
border : "1px solid" ,
144
- color : hallowButtonVars . color ,
145
- borderColor : hallowButtonVars . borderColor ,
82
+ color : hallowVars . color ,
83
+ borderColor : hallowVars . borderColor ,
146
84
":hover" : {
147
- background : hallowButtonVars . hoverBackgroundColor ,
148
- color : hallowButtonVars . hoverColor ,
149
- borderColor : hallowButtonVars . hoverBorderColor ,
85
+ background : hallowVars . hoverBackgroundColor ,
86
+ color : hallowVars . hoverColor ,
87
+ borderColor : hallowVars . hoverBorderColor ,
150
88
} ,
151
89
":focus" : {
152
90
borderWidth : "2px" ,
153
- background : hallowButtonVars . focusBackgroundColor ,
154
- color : hallowButtonVars . focusColor ,
155
- borderColor : hallowButtonVars . focusBorderColor ,
91
+ background : hallowVars . focusBackgroundColor ,
92
+ color : hallowVars . focusColor ,
93
+ borderColor : hallowVars . focusBorderColor ,
156
94
} ,
157
95
":disabled" : {
158
- background : hallowButtonVars . disabledBackgroundColor ,
159
- color : hallowButtonVars . disabledColor ,
160
- borderColor : hallowButtonVars . disabledBorderColor ,
96
+ background : hallowVars . disabledBackgroundColor ,
97
+ color : hallowVars . disabledColor ,
98
+ borderColor : hallowVars . disabledBorderColor ,
161
99
} ,
162
100
} ,
163
101
} ,
0 commit comments