Skip to content

Commit 2e258cf

Browse files
author
Elliot
authored
fix(ListItem): Set background of disabled ListItemWrapper to transparent (#1938)
* Set background of disabled ListItemWrapperto transparent to avoid colors.background from coloring disabled items * Luke feedback
1 parent 1fe9ee1 commit 2e258cf

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/components/src/List/ListItemWrapper.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ export const ListItemWrapper = styled(ListItemWrapperInternal)`
7777
min-height: ${({ height }) => height}px;
7878
outline: none;
7979
text-decoration: none;
80-
transition: ${({ theme: { easings, transitions } }) =>
81-
`background ${transitions.quick}ms ${easings.ease},
82-
color ${transitions.quick}ms ${easings.ease}`};
8380
8481
& > button,
8582
& > a {
@@ -95,9 +92,11 @@ export const ListItemWrapper = styled(ListItemWrapperInternal)`
9592
font-weight: inherit;
9693
min-width: 0;
9794
outline: none;
98-
9995
text-align: left;
10096
text-decoration: none;
97+
transition: ${({ theme: { easings, transitions } }) =>
98+
`background ${transitions.quick}ms ${easings.ease},
99+
color ${transitions.quick}ms ${easings.ease}`};
101100
width: 100%;
102101
103102
&:hover,
@@ -156,7 +155,6 @@ export const ListItemWrapper = styled(ListItemWrapperInternal)`
156155
}
157156
158157
&:hover {
159-
background: ${({ theme: { colors } }) => colors.background};
160158
color: ${({ theme: { colors } }) => colors.text1};
161159
}
162160
}

packages/components/src/List/utils/listItemBackgroundColor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ export const listItemBackgroundColor = ({
5656
else renderedColor = 'transparent'
5757

5858
return css`
59-
background-color: ${renderedColor};
59+
background: ${renderedColor};
6060
`
6161
}

0 commit comments

Comments
 (0)