Skip to content

Commit ac60f26

Browse files
committed
fix: stuff
1 parent 0337dfd commit ac60f26

File tree

2 files changed

+17
-31
lines changed

2 files changed

+17
-31
lines changed

src/ui/text-field-addon/text-field-addon.css.ts

+15-30
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
import { style, styleVariants } from "@vanilla-extract/css";
1+
import { style, styleVariants, createVar } from "@vanilla-extract/css";
22
import {
33
inputBgVar,
4-
inputBorderColorVar,
54
inputBorderRadiusVar,
6-
inputBorderWidthVar,
75
inputPaddingXVar,
86
inputPaddingYVar,
97
inputHeightVar,
8+
inputDividerColorVar,
109
zIndexConfig,
1110
rootInput,
1211
input,
1312
borderFocusedLight,
1413
borderFocusedDark,
1514
} from "../text-field/text-field.css";
1615

16+
const borderWidthVar = createVar();
17+
1718
export const textFieldAddon = style({
1819
display: "flex",
1920
color: "inherit",
@@ -30,6 +31,9 @@ export const textFieldAddon = style({
3031
borderColor: "transparent",
3132
borderWidth: "1px",
3233
borderStyle: "solid",
34+
vars: {
35+
[borderWidthVar]: "1px",
36+
},
3337
selectors: {
3438
[`${rootInput}[data-element-type='textarea'] &`]: {
3539
display: "none",
@@ -64,25 +68,6 @@ export const textFieldAddonPositions = styleVariants({
6468
],
6569
});
6670

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-
8671
export const textFieldAddonDivider = styleVariants({
8772
end: [
8873
style({
@@ -96,11 +81,11 @@ export const textFieldAddonDivider = styleVariants({
9681
"&:before": {
9782
content: '""',
9883
position: "absolute",
99-
top: `calc(-1 * ${inputBorderWidthVar})`,
100-
bottom: `calc(-1 * ${inputBorderWidthVar})`,
84+
top: `calc(-1 * ${borderWidthVar})`,
85+
bottom: `calc(-1 * ${borderWidthVar})`,
10186
left: 0,
102-
width: inputBorderWidthVar,
103-
background: inputBorderColorVar,
87+
width: borderWidthVar,
88+
background: inputDividerColorVar,
10489
transition: "all 200ms",
10590
},
10691
},
@@ -118,11 +103,11 @@ export const textFieldAddonDivider = styleVariants({
118103
"&:before": {
119104
content: '""',
120105
position: "absolute",
121-
top: `calc(-1 * ${inputBorderWidthVar})`,
122-
bottom: `calc(-1 * ${inputBorderWidthVar})`,
106+
top: `calc(-1 * ${borderWidthVar})`,
107+
bottom: `calc(-1 * ${borderWidthVar})`,
123108
right: 0,
124-
width: inputBorderWidthVar,
125-
background: inputBorderColorVar,
109+
width: borderWidthVar,
110+
background: inputDividerColorVar,
126111
transition: "all 200ms",
127112
},
128113
},

src/ui/text-field/text-field.css.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
TextFieldSizeProperty,
1818
TextFieldVarKeys,
1919
} from "./text-field.vars.css";
20-
import { textFieldAddon } from "../text-field-addon/text-field-addon.css";
2120
import { slotVars } from "../../styles/theme-builder/slot-vars.css";
2221

2322
import { unstyledButton } from "../button/button.css";
@@ -34,6 +33,7 @@ export const inputOpacityVar = createVar();
3433
export const inputHeightVar = createVar();
3534
export const inputPaddingXVar = createVar();
3635
export const inputPaddingYVar = createVar();
36+
export const inputDividerColorVar = createVar();
3737

3838
// Manage z-index values
3939
export const zIndexConfig = {
@@ -421,6 +421,7 @@ function genCompoundVariants({
421421
}),
422422
[inputBoxShadowVar]: varGetter({ intent, property: "boxShadow" }),
423423
[inputOpacityVar]: varGetter({ intent, property: "opacity" }),
424+
[inputDividerColorVar]: varGetter({ intent, property: "borderColor" }),
424425
},
425426
selectors: {
426427
"&:hover": {

0 commit comments

Comments
 (0)