1
- import { style , styleVariants } from "@vanilla-extract/css" ;
1
+ import { style , styleVariants , createVar } from "@vanilla-extract/css" ;
2
2
import {
3
3
inputBgVar ,
4
- inputBorderColorVar ,
5
4
inputBorderRadiusVar ,
6
- inputBorderWidthVar ,
7
5
inputPaddingXVar ,
8
6
inputPaddingYVar ,
9
7
inputHeightVar ,
8
+ inputDividerColorVar ,
10
9
zIndexConfig ,
11
10
rootInput ,
12
11
input ,
13
12
borderFocusedLight ,
14
13
borderFocusedDark ,
15
14
} from "../text-field/text-field.css" ;
16
15
16
+ const borderWidthVar = createVar ( ) ;
17
+
17
18
export const textFieldAddon = style ( {
18
19
display : "flex" ,
19
20
color : "inherit" ,
@@ -30,6 +31,9 @@ export const textFieldAddon = style({
30
31
borderColor : "transparent" ,
31
32
borderWidth : "1px" ,
32
33
borderStyle : "solid" ,
34
+ vars : {
35
+ [ borderWidthVar ] : "1px" ,
36
+ } ,
33
37
selectors : {
34
38
[ `${ rootInput } [data-element-type='textarea'] &` ] : {
35
39
display : "none" ,
@@ -64,25 +68,6 @@ export const textFieldAddonPositions = styleVariants({
64
68
] ,
65
69
} ) ;
66
70
67
- // export const textFieldAddonSizes = styleVariants({
68
- // sm: [
69
- // style({
70
- // paddingLeft: themeVars.space[6],
71
- // paddingRight: themeVars.space[6],
72
- // paddingTop: themeVars.space[4],
73
- // paddingBottom: themeVars.space[4],
74
- // }),
75
- // ],
76
- // md: [
77
- // style({
78
- // paddingLeft: themeVars.space[8],
79
- // paddingRight: themeVars.space[8],
80
- // paddingTop: themeVars.space[4],
81
- // paddingBottom: themeVars.space[4],
82
- // }),
83
- // ],
84
- // });
85
-
86
71
export const textFieldAddonDivider = styleVariants ( {
87
72
end : [
88
73
style ( {
@@ -96,11 +81,11 @@ export const textFieldAddonDivider = styleVariants({
96
81
"&:before" : {
97
82
content : '""' ,
98
83
position : "absolute" ,
99
- top : `calc(-1 * ${ inputBorderWidthVar } )` ,
100
- bottom : `calc(-1 * ${ inputBorderWidthVar } )` ,
84
+ top : `calc(-1 * ${ borderWidthVar } )` ,
85
+ bottom : `calc(-1 * ${ borderWidthVar } )` ,
101
86
left : 0 ,
102
- width : inputBorderWidthVar ,
103
- background : inputBorderColorVar ,
87
+ width : borderWidthVar ,
88
+ background : inputDividerColorVar ,
104
89
transition : "all 200ms" ,
105
90
} ,
106
91
} ,
@@ -118,11 +103,11 @@ export const textFieldAddonDivider = styleVariants({
118
103
"&:before" : {
119
104
content : '""' ,
120
105
position : "absolute" ,
121
- top : `calc(-1 * ${ inputBorderWidthVar } )` ,
122
- bottom : `calc(-1 * ${ inputBorderWidthVar } )` ,
106
+ top : `calc(-1 * ${ borderWidthVar } )` ,
107
+ bottom : `calc(-1 * ${ borderWidthVar } )` ,
123
108
right : 0 ,
124
- width : inputBorderWidthVar ,
125
- background : inputBorderColorVar ,
109
+ width : borderWidthVar ,
110
+ background : inputDividerColorVar ,
126
111
transition : "all 200ms" ,
127
112
} ,
128
113
} ,
0 commit comments