Skip to content

Commit 85e2bdc

Browse files
authored
fix: ListRow zebra striping
Fix semi-transparent layering in expandable rows
1 parent 672503a commit 85e2bdc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/gamut/src/List/ListRow.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export const ListRow = forwardRef<HTMLLIElement, ListRowProps>(
126126
c_sm: undefined,
127127
}}
128128
isOl={renderNumbering}
129+
parentEl
129130
role={role}
130131
scrollable={scrollable}
131132
tabIndex={tabIndex}

packages/gamut/src/List/elements.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ const rowStates = states({
7474
display: 'flex',
7575
flexDirection: { _: 'column', c_base: 'row', c_sm: 'column' },
7676
},
77+
/**
78+
* Only the outermost element needs to inherit the background - otherwise it can stack with semitransparent bg colors and look off.
79+
*/
80+
parentEl: {
81+
bg: 'inherit',
82+
},
7783
});
7884

7985
const interactiveState = states({
@@ -176,7 +182,6 @@ export interface RowProps
176182
export const RowEl = styled('li', styledOptions<'li'>())<RowProps>(
177183
css({
178184
py: { _: 0, c_base: 8, c_sm: 0 },
179-
bg: 'inherit',
180185
width: 1,
181186
}),
182187
variance.compose(grid, flex),

0 commit comments

Comments
 (0)