Skip to content

Commit

Permalink
Fix default and hover border-color of InputBase (#2910)
Browse files Browse the repository at this point in the history
Fix InputBase `border-color` in default state and on hover to match design.

Co-authored-by: Kerstin Reichinger <[email protected]>
  • Loading branch information
kerstin97 and kerstinreichinger-vivid authored Dec 11, 2024
1 parent a4fcdeb commit a30f0ee
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/early-ears-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@comet/admin-theme": patch
"@comet/admin": patch
---

Fix `border-color` of `InputBase` on default and hover state
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const getMuiInputBase: GetMuiComponentTheme<"MuiInputBase"> = (component,
...component,
styleOverrides: mergeOverrideStyles<"MuiInputBase">(component?.styleOverrides, {
root: {
border: `1px solid ${palette.grey[200]}`,
border: `1px solid ${palette.grey[100]}`,
borderRadius: 2,
backgroundColor: "#fff",

Expand All @@ -19,6 +19,10 @@ export const getMuiInputBase: GetMuiComponentTheme<"MuiInputBase"> = (component,
borderColor: palette.grey[100],
backgroundColor: palette.grey[50],
},

[`&:hover:not(.${inputBaseClasses.disabled}):not(.${inputBaseClasses.focused})`]: {
borderColor: palette.grey[200],
},
},
adornedStart: {
paddingLeft: spacing(2),
Expand Down
8 changes: 8 additions & 0 deletions packages/admin/admin/src/form/FieldContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,21 @@ const InnerContainer = createComponentSlot("div")<FieldContainerClassKey, OwnerS
[class*="${inputBaseClasses.root}"]:not([class*="${inputBaseClasses.focused}"]) {
border-color: ${theme.palette.error.main};
}
[class*="${inputBaseClasses.root}"]:hover:not([class*="${inputBaseClasses.focused}"]) {
border-color: ${theme.palette.error.main};
}
`}
${ownerState.hasWarning &&
css`
[class*="${inputBaseClasses.root}"]:not([class*="${inputBaseClasses.focused}"]) {
border-color: ${theme.palette.warning.main};
}
[class*="${inputBaseClasses.root}"]:hover:not([class*="${inputBaseClasses.focused}"]) {
border-color: ${theme.palette.warning.main};
}
`}
`,
);
Expand Down

0 comments on commit a30f0ee

Please sign in to comment.