Skip to content

Commit

Permalink
fix: stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyaaa committed Jul 19, 2024
1 parent 0337dfd commit ac60f26
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 31 deletions.
45 changes: 15 additions & 30 deletions src/ui/text-field-addon/text-field-addon.css.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { style, styleVariants } from "@vanilla-extract/css";
import { style, styleVariants, createVar } from "@vanilla-extract/css";
import {
inputBgVar,
inputBorderColorVar,
inputBorderRadiusVar,
inputBorderWidthVar,
inputPaddingXVar,
inputPaddingYVar,
inputHeightVar,
inputDividerColorVar,
zIndexConfig,
rootInput,
input,
borderFocusedLight,
borderFocusedDark,
} from "../text-field/text-field.css";

const borderWidthVar = createVar();

export const textFieldAddon = style({
display: "flex",
color: "inherit",
Expand All @@ -30,6 +31,9 @@ export const textFieldAddon = style({
borderColor: "transparent",
borderWidth: "1px",
borderStyle: "solid",
vars: {
[borderWidthVar]: "1px",
},
selectors: {
[`${rootInput}[data-element-type='textarea'] &`]: {
display: "none",
Expand Down Expand Up @@ -64,25 +68,6 @@ export const textFieldAddonPositions = styleVariants({
],
});

// export const textFieldAddonSizes = styleVariants({
// sm: [
// style({
// paddingLeft: themeVars.space[6],
// paddingRight: themeVars.space[6],
// paddingTop: themeVars.space[4],
// paddingBottom: themeVars.space[4],
// }),
// ],
// md: [
// style({
// paddingLeft: themeVars.space[8],
// paddingRight: themeVars.space[8],
// paddingTop: themeVars.space[4],
// paddingBottom: themeVars.space[4],
// }),
// ],
// });

export const textFieldAddonDivider = styleVariants({
end: [
style({
Expand All @@ -96,11 +81,11 @@ export const textFieldAddonDivider = styleVariants({
"&:before": {
content: '""',
position: "absolute",
top: `calc(-1 * ${inputBorderWidthVar})`,
bottom: `calc(-1 * ${inputBorderWidthVar})`,
top: `calc(-1 * ${borderWidthVar})`,
bottom: `calc(-1 * ${borderWidthVar})`,
left: 0,
width: inputBorderWidthVar,
background: inputBorderColorVar,
width: borderWidthVar,
background: inputDividerColorVar,
transition: "all 200ms",
},
},
Expand All @@ -118,11 +103,11 @@ export const textFieldAddonDivider = styleVariants({
"&:before": {
content: '""',
position: "absolute",
top: `calc(-1 * ${inputBorderWidthVar})`,
bottom: `calc(-1 * ${inputBorderWidthVar})`,
top: `calc(-1 * ${borderWidthVar})`,
bottom: `calc(-1 * ${borderWidthVar})`,
right: 0,
width: inputBorderWidthVar,
background: inputBorderColorVar,
width: borderWidthVar,
background: inputDividerColorVar,
transition: "all 200ms",
},
},
Expand Down
3 changes: 2 additions & 1 deletion src/ui/text-field/text-field.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
TextFieldSizeProperty,
TextFieldVarKeys,
} from "./text-field.vars.css";
import { textFieldAddon } from "../text-field-addon/text-field-addon.css";
import { slotVars } from "../../styles/theme-builder/slot-vars.css";

import { unstyledButton } from "../button/button.css";
Expand All @@ -34,6 +33,7 @@ export const inputOpacityVar = createVar();
export const inputHeightVar = createVar();
export const inputPaddingXVar = createVar();
export const inputPaddingYVar = createVar();
export const inputDividerColorVar = createVar();

// Manage z-index values
export const zIndexConfig = {
Expand Down Expand Up @@ -421,6 +421,7 @@ function genCompoundVariants({
}),
[inputBoxShadowVar]: varGetter({ intent, property: "boxShadow" }),
[inputOpacityVar]: varGetter({ intent, property: "opacity" }),
[inputDividerColorVar]: varGetter({ intent, property: "borderColor" }),
},
selectors: {
"&:hover": {
Expand Down

0 comments on commit ac60f26

Please sign in to comment.