1
- var flattenColorPalette = require ( 'tailwindcss/lib/util/flattenColorPalette' ) . default ;
1
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
2
+ var flattenColorPalette = require ( "tailwindcss/lib/util/flattenColorPalette" ) . default ;
2
3
3
4
module . exports = {
4
5
theme : {
5
- borderColor : theme => ( {
6
+ borderColor : ( theme ) => ( {
6
7
color : {
7
8
1 : "var(--calcite-ui-border-1)" ,
8
9
2 : "var(--calcite-ui-border-2)" ,
@@ -18,16 +19,16 @@ module.exports = {
18
19
"color-warning" : theme ( "colors.warning" ) ,
19
20
"color-danger" : theme ( "colors.danger" ) ,
20
21
"color-danger-hover" : theme ( "colors.danger-hover" ) ,
21
- "color-danger-press" : theme ( "colors.danger-press" ) ,
22
+ "color-danger-press" : theme ( "colors.danger-press" )
22
23
} ) ,
23
24
colors : {
24
- " brand" : "var(--calcite-ui-brand)" ,
25
+ brand : "var(--calcite-ui-brand)" ,
25
26
"brand-hover" : "var(--calcite-ui-brand-hover)" ,
26
27
"brand-press" : "var(--calcite-ui-brand-press)" ,
27
- " info" : "var(--calcite-ui-info)" ,
28
- " success" : "var(--calcite-ui-success)" ,
29
- " warning" : "var(--calcite-ui-warning)" ,
30
- " danger" : "var(--calcite-ui-danger)" ,
28
+ info : "var(--calcite-ui-info)" ,
29
+ success : "var(--calcite-ui-success)" ,
30
+ warning : "var(--calcite-ui-warning)" ,
31
+ danger : "var(--calcite-ui-danger)" ,
31
32
"danger-hover" : "var(--calcite-ui-danger-hover)" ,
32
33
"danger-press" : "var(--calcite-ui-danger-press)" ,
33
34
background : {
@@ -36,7 +37,7 @@ module.exports = {
36
37
1 : "var(--calcite-ui-foreground-1)" ,
37
38
2 : "var(--calcite-ui-foreground-2)" ,
38
39
3 : "var(--calcite-ui-foreground-3)"
39
- } ,
40
+ }
40
41
} ,
41
42
text : {
42
43
1 : "var(--calcite-ui-text-1)" ,
@@ -55,78 +56,81 @@ module.exports = {
55
56
} ,
56
57
fontSize : {
57
58
// assets/styles/_type
58
- "-3" : "var(--calcite-font-size--3)" , // 10px
59
- "-2" : "var(--calcite-font-size--2)" , // 12px
60
- "-1" : "var(--calcite-font-size--1)" , // 14px
61
- 0 : "var(--calcite-font-size-0)" , // 16px
62
- 1 : "var(--calcite-font-size-1)" , // 18px
63
- 2 : "var(--calcite-font-size-2)" , // 20px
64
- 3 : "var(--calcite-font-size-3)" , // 26px
65
- 4 : "var(--calcite-font-size-4)" , // 32px
66
- 5 : "var(--calcite-font-size-5)" , // 40px
67
- 6 : "var(--calcite-font-size-6)" , // 48px
68
- 7 : "var(--calcite-font-size-7)" , // 56px
69
- 8 : "var(--calcite-font-size-8)" , // 64px
70
- "-3h" : [ "var(--calcite-font-size--3)" , { lineHeight : '0.75rem' } ] , // 10px (0.625rem)
71
- "-2h" : [ "var(--calcite-font-size--2)" , { lineHeight : '1rem' } ] , // 12px (0.75rem)
72
- "-1h" : [ "var(--calcite-font-size--1)" , { lineHeight : '1rem' } ] , // 14px (0.875rem)
73
- "0h" : [ "var(--calcite-font-size-0)" , { lineHeight : '1.25rem' } ] , // 16px (1rem)
74
- "1h" : [ "var(--calcite-font-size-1)" , { lineHeight : '1.5rem' } ] , // 18px (1.125rem)
75
- "2h" : [ "var(--calcite-font-size-2)" , { lineHeight : '1.5rem' } ] , // 20px (1.25rem)
76
- "3h" : [ "var(--calcite-font-size-3)" , { lineHeight : '2rem' } ] , // 26px (1.625rem)
77
- "4h" : [ "var(--calcite-font-size-4)" , { lineHeight : '2.5rem' } ] , // 32px (2rem)
78
- "5h" : [ "var(--calcite-font-size-5)" , { lineHeight : '3rem' } ] , // 40px (2.5rem)
79
- "6h" : [ "var(--calcite-font-size-6)" , { lineHeight : '4rem' } ] , // 48px (3rem)
80
- "7h" : [ "var(--calcite-font-size-7)" , { lineHeight : '4rem' } ] , // 56px (3.5rem)
81
- "8h" : [ "var(--calcite-font-size-8)" , { lineHeight : '5rem' } ] , // 64px (4rem)
82
- "-3-wrap" : [ "var(--calcite-font-size--3)" , { lineHeight : '1.375' } ] ,
83
- "-2-wrap" : [ "var(--calcite-font-size--2)" , { lineHeight : '1.375' } ] ,
84
- "-1-wrap" : [ "var(--calcite-font-size--1)" , { lineHeight : '1.375' } ] ,
85
- "0-wrap" : [ "var(--calcite-font-size-0)" , { lineHeight : '1.375' } ] ,
86
- "1-wrap" : [ "var(--calcite-font-size-1)" , { lineHeight : '1.375' } ] ,
87
- "2-wrap" : [ "var(--calcite-font-size-2)" , { lineHeight : '1.375' } ] ,
88
- "3-wrap" : [ "var(--calcite-font-size-3)" , { lineHeight : '1.25' } ] ,
89
- "4-wrap" : [ "var(--calcite-font-size-4)" , { lineHeight : '1.25' } ] ,
90
- "5-wrap" : [ "var(--calcite-font-size-5)" , { lineHeight : '1.25' } ] ,
91
- "6-wrap" : [ "var(--calcite-font-size-6)" , { lineHeight : '1.25' } ] ,
92
- "7-wrap" : [ "var(--calcite-font-size-7)" , { lineHeight : '1.25' } ] ,
93
- "8-wrap" : [ "var(--calcite-font-size-8)" , { lineHeight : '1.25' } ] ,
59
+ "-3" : "var(--calcite-font-size--3)" , // 10px
60
+ "-2" : "var(--calcite-font-size--2)" , // 12px
61
+ "-1" : "var(--calcite-font-size--1)" , // 14px
62
+ 0 : "var(--calcite-font-size-0)" , // 16px
63
+ 1 : "var(--calcite-font-size-1)" , // 18px
64
+ 2 : "var(--calcite-font-size-2)" , // 20px
65
+ 3 : "var(--calcite-font-size-3)" , // 26px
66
+ 4 : "var(--calcite-font-size-4)" , // 32px
67
+ 5 : "var(--calcite-font-size-5)" , // 40px
68
+ 6 : "var(--calcite-font-size-6)" , // 48px
69
+ 7 : "var(--calcite-font-size-7)" , // 56px
70
+ 8 : "var(--calcite-font-size-8)" , // 64px
71
+ // TODO: temp selectors to be renamed before closing https://github.com/Esri/calcite-components/issues/1500.
72
+ // at this point all existing instances of text-N should be replaced with either text-Nh or text-N-wrap and we
73
+ // should be able to safely drop the "h" suffix.
74
+ "-3h" : [ "var(--calcite-font-size--3)" , { lineHeight : "0.75rem" } ] , // 10px (0.625rem)
75
+ "-2h" : [ "var(--calcite-font-size--2)" , { lineHeight : "1rem" } ] , // 12px (0.75rem)
76
+ "-1h" : [ "var(--calcite-font-size--1)" , { lineHeight : "1rem" } ] , // 14px (0.875rem)
77
+ "0h" : [ "var(--calcite-font-size-0)" , { lineHeight : "1.25rem" } ] , // 16px (1rem)
78
+ "1h" : [ "var(--calcite-font-size-1)" , { lineHeight : "1.5rem" } ] , // 18px (1.125rem)
79
+ "2h" : [ "var(--calcite-font-size-2)" , { lineHeight : "1.5rem" } ] , // 20px (1.25rem)
80
+ "3h" : [ "var(--calcite-font-size-3)" , { lineHeight : "2rem" } ] , // 26px (1.625rem)
81
+ "4h" : [ "var(--calcite-font-size-4)" , { lineHeight : "2.5rem" } ] , // 32px (2rem)
82
+ "5h" : [ "var(--calcite-font-size-5)" , { lineHeight : "3rem" } ] , // 40px (2.5rem)
83
+ "6h" : [ "var(--calcite-font-size-6)" , { lineHeight : "4rem" } ] , // 48px (3rem)
84
+ "7h" : [ "var(--calcite-font-size-7)" , { lineHeight : "4rem" } ] , // 56px (3.5rem)
85
+ "8h" : [ "var(--calcite-font-size-8)" , { lineHeight : "5rem" } ] , // 64px (4rem)
86
+ "-3-wrap" : [ "var(--calcite-font-size--3)" , { lineHeight : "1.375" } ] ,
87
+ "-2-wrap" : [ "var(--calcite-font-size--2)" , { lineHeight : "1.375" } ] ,
88
+ "-1-wrap" : [ "var(--calcite-font-size--1)" , { lineHeight : "1.375" } ] ,
89
+ "0-wrap" : [ "var(--calcite-font-size-0)" , { lineHeight : "1.375" } ] ,
90
+ "1-wrap" : [ "var(--calcite-font-size-1)" , { lineHeight : "1.375" } ] ,
91
+ "2-wrap" : [ "var(--calcite-font-size-2)" , { lineHeight : "1.375" } ] ,
92
+ "3-wrap" : [ "var(--calcite-font-size-3)" , { lineHeight : "1.25" } ] ,
93
+ "4-wrap" : [ "var(--calcite-font-size-4)" , { lineHeight : "1.25" } ] ,
94
+ "5-wrap" : [ "var(--calcite-font-size-5)" , { lineHeight : "1.25" } ] ,
95
+ "6-wrap" : [ "var(--calcite-font-size-6)" , { lineHeight : "1.25" } ] ,
96
+ "7-wrap" : [ "var(--calcite-font-size-7)" , { lineHeight : "1.25" } ] ,
97
+ "8-wrap" : [ "var(--calcite-font-size-8)" , { lineHeight : "1.25" } ]
94
98
} ,
95
99
fontWeight : {
100
+ // assets/styles/_type
96
101
light : "var(--calcite-font-weight-light)" ,
97
102
normal : "var(--calcite-font-weight-normal)" ,
98
103
medium : "var(--calcite-font-weight-medium)" ,
99
104
bold : "var(--calcite-font-weight-bold)"
100
105
} ,
101
106
screens : {
102
- 's' : ' 480px' ,
103
- 'm' : ' 864px' ,
104
- 'l' : ' 1024px' ,
105
- 'xl' : ' 1440px'
107
+ s : " 480px" ,
108
+ m : " 864px" ,
109
+ l : " 1024px" ,
110
+ xl : " 1440px"
106
111
} ,
107
- textColor : theme => ( {
112
+ textColor : ( theme ) => ( {
108
113
color : theme ( "colors.text" )
109
114
} ) ,
110
- backgroundColor : theme => ( {
115
+ backgroundColor : ( theme ) => ( {
111
116
...theme ( "colors.background" ) ,
112
117
transparent : theme ( "colors.transparent" ) ,
113
118
brand : theme ( "colors.brand" ) ,
114
119
"brand-hover" : theme ( "colors.brand-hover" ) ,
115
120
"brand-press" : theme ( "colors.brand-press" ) ,
116
- "brand" : theme ( "colors.brand" ) ,
117
- "info" : theme ( "colors.info" ) ,
118
- "success" : theme ( "colors.success" ) ,
119
- "warning" : theme ( "colors.warning" ) ,
120
- "danger" : theme ( "colors.danger" ) ,
121
+ info : theme ( "colors.info" ) ,
122
+ success : theme ( "colors.success" ) ,
123
+ warning : theme ( "colors.warning" ) ,
124
+ danger : theme ( "colors.danger" ) ,
121
125
"danger-hover" : theme ( "colors.danger-hover" ) ,
122
- "danger-press" : theme ( "colors.danger-press" ) ,
126
+ "danger-press" : theme ( "colors.danger-press" )
123
127
} ) ,
124
128
extend : {
125
129
animation : {
126
- "in" : "in 300ms ease-in-out" ,
127
- "in-down" : "in-down 300ms ease-in-out" ,
128
- "in-up" : "in-up 300ms ease-in-out" ,
129
- "in-scale" : "in-scale 300ms linear"
130
+ in : "in var(--calcite-animation-timing) ease-in-out" ,
131
+ "in-down" : "in-down var(--calcite-animation-timing) ease-in-out" ,
132
+ "in-up" : "in-up var(--calcite-animation-timing) ease-in-out" ,
133
+ "in-scale" : "in-scale var(--calcite-animation-timing) linear"
130
134
} ,
131
135
borderRadius : {
132
136
half : "50%"
@@ -139,15 +143,15 @@ module.exports = {
139
143
2 : "0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08)" ,
140
144
"2-lg" : "0 12px 32px -2px rgba(0, 0, 0, 0.1), 0 4px 20px 0 rgba(0, 0, 0, 0.08)" ,
141
145
"2-sm" : "0 2px 12px -4px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.16)" ,
142
- ' border-bottom' : ' 0 1px 0 var(--calcite-ui-border-3)' ,
143
- ' outline-active' : ' 0 0 0 1px var(--calcite-ui-brand)' ,
144
- ' none' : ' none' ,
146
+ " border-bottom" : " 0 1px 0 var(--calcite-ui-border-3)" ,
147
+ " outline-active" : " 0 0 0 1px var(--calcite-ui-brand)" ,
148
+ none : " none"
145
149
} ,
146
- fill : theme => ( {
150
+ fill : ( theme ) => ( {
147
151
color : theme ( "colors.text" )
148
152
} ) ,
149
153
keyframes : {
150
- "in" : {
154
+ in : {
151
155
"0%" : {
152
156
opacity : 0
153
157
} ,
@@ -187,12 +191,14 @@ module.exports = {
187
191
}
188
192
} ,
189
193
opacity : {
190
- disabled : "0.5 "
194
+ disabled : "var(--calcite-ui-opacity-disabled) "
191
195
} ,
192
196
spacing : {
193
- "0.5" : "0.125rem" ,
194
- "2.5" : "0.625rem" ,
195
- "3.5" : "0.875rem"
197
+ 0.5 : "0.125rem" ,
198
+ 2.5 : "0.625rem" ,
199
+ 3.5 : "0.875rem" ,
200
+ 9 : "2.25rem" ,
201
+ 11 : "2.75rem"
196
202
} ,
197
203
transitionProperty : {
198
204
margin : "margin" ,
@@ -213,14 +219,22 @@ module.exports = {
213
219
".focus-base" : {
214
220
"outline-offset" : 0 ,
215
221
"outline-color" : "transparent" ,
216
- " transition" : "outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out"
222
+ transition : "outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out"
217
223
} ,
218
224
".focus-outset" : {
219
- " outline" : "2px solid var(--calcite-ui-brand)" ,
225
+ outline : "2px solid var(--calcite-ui-brand)" ,
220
226
"outline-offset" : "2px"
221
227
} ,
222
228
".focus-inset" : {
223
- "outline" : "2px solid var(--calcite-ui-brand)" ,
229
+ outline : "2px solid var(--calcite-ui-brand)" ,
230
+ "outline-offset" : "-2px"
231
+ } ,
232
+ ".focus-outset-danger" : {
233
+ outline : "2px solid var(--calcite-ui-danger)" ,
234
+ "outline-offset" : "2px"
235
+ } ,
236
+ ".focus-inset-danger" : {
237
+ outline : "2px solid var(--calcite-ui-danger)" ,
224
238
"outline-offset" : "-2px"
225
239
} ,
226
240
".transition-default" : {
@@ -229,29 +243,29 @@ module.exports = {
229
243
"transition-timing-function" : "ease-in-out" ,
230
244
"transition-delay" : "0s"
231
245
}
232
- }
246
+ } ;
233
247
addUtilities ( newUtilities ) ;
234
248
} ,
235
- ( { addUtilities, e , theme, variants } ) => {
236
- const colors = flattenColorPalette ( theme ( ' borderColor' ) ) ;
237
- delete colors [ ' default' ] ;
249
+ ( { addUtilities, theme, variants } ) => {
250
+ const colors = flattenColorPalette ( theme ( " borderColor" ) ) ;
251
+ delete colors [ " default" ] ;
238
252
239
- const colorMap = Object . keys ( colors )
240
- . map ( color => ( {
241
- [ `.border-t-${ color } ` ] : { borderTopColor : colors [ color ] } ,
242
- [ `.border-r-${ color } ` ] : { borderRightColor : colors [ color ] } ,
243
- [ `.border-b-${ color } ` ] : { borderBottomColor : colors [ color ] } ,
244
- [ `.border-l-${ color } ` ] : { borderLeftColor : colors [ color ] } ,
245
- } ) ) ;
253
+ const colorMap = Object . keys ( colors ) . map ( ( color ) => ( {
254
+ [ `.border-t-${ color } ` ] : { borderTopColor : colors [ color ] } ,
255
+ [ `.border-r-${ color } ` ] : { borderRightColor : colors [ color ] } ,
256
+ [ `.border-b-${ color } ` ] : { borderBottomColor : colors [ color ] } ,
257
+ [ `.border-l-${ color } ` ] : { borderLeftColor : colors [ color ] }
258
+ } ) ) ;
246
259
const utilities = Object . assign ( { } , ...colorMap ) ;
247
260
248
- addUtilities ( utilities , variants ( ' borderColor' ) ) ;
249
- } ,
261
+ addUtilities ( utilities , variants ( " borderColor" ) ) ;
262
+ }
250
263
] ,
251
264
future : {
252
- removeDeprecatedGapUtilities : true ,
265
+ removeDeprecatedGapUtilities : true
253
266
} ,
254
267
variants : {
255
- boxShadow : [ 'responsive' , 'hover' , 'focus' , 'active' ]
268
+ boxShadow : [ "responsive" , "hover" , "focus" , "active" ] ,
269
+ borderWidth : [ "responsive" , "hover" , "focus" , "active" ]
256
270
}
257
- }
271
+ } ;
0 commit comments