@@ -39,13 +39,6 @@ export const StyledMotionListItem = styled(motion.div)<StyledListItemProps>`
39
39
}
40
40
` }
41
41
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
-
49
42
${ ( {
50
43
$isInAccordion,
51
44
$isOpen,
@@ -54,18 +47,30 @@ export const StyledMotionListItem = styled(motion.div)<StyledListItemProps>`
54
47
$shouldForceBottomLine,
55
48
$shouldShowSeparatorBelow,
56
49
theme,
57
- } : StyledListItemProps ) =>
58
- ( $shouldShowSeparatorBelow ||
50
+ } : StyledListItemProps ) => {
51
+ if (
52
+ $shouldShowSeparatorBelow ||
59
53
( ( ! $isOpen || $isWrapped || $isInAccordion ) &&
60
54
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
+ ` ;
67
62
}
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
+ } }
69
74
70
75
${ ( { $isWrapped } ) =>
71
76
$isWrapped &&
0 commit comments