Skip to content

Commit ece9854

Browse files
author
Jannik Weise
committed
🐛 Fix list item to don't show forced bottom line if lines are deactivated in theme settings
1 parent dd4efa0 commit ece9854

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

packages/core/src/components/list/list-item/ListItem.styles.ts

+21-16
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ export const StyledMotionListItem = styled(motion.div)<StyledListItemProps>`
3939
}
4040
`}
4141
42-
${({ $shouldForceBottomLine, $shouldShowSeparatorBelow, theme }: StyledListItemProps) =>
43-
$shouldForceBottomLine &&
44-
css`
45-
border-bottom: ${$shouldShowSeparatorBelow ? '4px' : '1px'} solid
46-
rgba(${theme['headline-rgb']}, 0.5);
47-
`}
48-
4942
${({
5043
$isInAccordion,
5144
$isOpen,
@@ -54,18 +47,30 @@ export const StyledMotionListItem = styled(motion.div)<StyledListItemProps>`
5447
$shouldForceBottomLine,
5548
$shouldShowSeparatorBelow,
5649
theme,
57-
}: StyledListItemProps) =>
58-
($shouldShowSeparatorBelow ||
50+
}: StyledListItemProps) => {
51+
if (
52+
$shouldShowSeparatorBelow ||
5953
((!$isOpen || $isWrapped || $isInAccordion) &&
6054
theme.accordionLines &&
61-
!$shouldHideBottomLine &&
62-
!$shouldForceBottomLine)) &&
63-
css`
64-
&&:not(:last-child) {
65-
border-bottom: ${$shouldShowSeparatorBelow ? '4px' : '1px'} solid
66-
rgba(${theme['headline-rgb']}, 0.5);
55+
!$shouldHideBottomLine)
56+
) {
57+
if ($shouldForceBottomLine) {
58+
return css`
59+
border-bottom: ${$shouldShowSeparatorBelow ? '4px' : '1px'} solid
60+
rgba(${theme['headline-rgb']}, 0.5);
61+
`;
6762
}
68-
`}
63+
64+
return css`
65+
&&:not(:last-child) {
66+
border-bottom: ${$shouldShowSeparatorBelow ? '4px' : '1px'} solid
67+
rgba(${theme['headline-rgb']}, 0.5);
68+
}
69+
`;
70+
}
71+
72+
return undefined;
73+
}}
6974
7075
${({ $isWrapped }) =>
7176
$isWrapped &&

0 commit comments

Comments
 (0)