Skip to content

Commit f01f8cf

Browse files
committed
Add comments explaing stylings
1 parent 168d909 commit f01f8cf

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

site/src/components/InputGroup/InputGroup.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@ export const InputGroup: FC<HTMLProps<HTMLDivElement>> = (props) => {
55
<div
66
{...props}
77
css={{
8-
"&": {
9-
display: "flex",
10-
alignItems: "flex-start",
8+
display: "flex",
9+
alignItems: "flex-start",
10+
11+
// Overlap borders to avoid displaying double borders between elements.
12+
"& > *:not(:last-child)": {
13+
marginRight: -1,
1114
},
1215

16+
// Ensure the border of the hovered element is visible when borders
17+
// overlap.
1318
"& > *:hover": {
1419
zIndex: 1,
1520
},
1621

17-
"& > *:not(:last-child)": {
18-
marginRight: -1,
22+
// Display border elements when focused or in an error state, both of
23+
// which take priority over hover.
24+
"& .Mui-focused, & .Mui-error": {
25+
zIndex: 2,
1926
},
2027

2128
"& > *:first-child": {
@@ -45,10 +52,6 @@ export const InputGroup: FC<HTMLProps<HTMLDivElement>> = (props) => {
4552
borderRadius: 0,
4653
},
4754
},
48-
49-
"& .Mui-focused, & .Mui-error": {
50-
zIndex: 2,
51-
},
5255
}}
5356
/>
5457
);

0 commit comments

Comments
 (0)