Skip to content

Commit

Permalink
feat(table): fixed first column
Browse files Browse the repository at this point in the history
  • Loading branch information
malegreIndec committed Feb 6, 2024
1 parent c932582 commit 15dbaea
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions src/theme/components/table.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
const baseStyles = {
fontSize: '16px',
height: '35px',
table: {
background: 'brand.white',
borderRadius: '0 0 10px 10px'
}
};

const stickyTable = {
position: 'sticky',
left: '0'
};

const table = {
variants: {
reg: {
fontSize: '16px',
height: '35px',
table: {
background: 'brand.white',
borderRadius: '0 0 10px 10px'
},
...baseStyles,
thead: {
color: 'brand.primary'
},
Expand All @@ -29,6 +38,28 @@ const table = {
textAlign: 'left',
padding: '10px 20px'
}
},

fixedFirstColumn: {
...baseStyles,
tr: {
'& th:first-of-type': {
...stickyTable,
backgroundColor: 'brand.white'
},
'&:nth-of-type(even) td:first-of-type ': {
backgroundColor: 'brand.neutral50'
},
'&:nth-of-type(odd) td:first-of-type ': {
backgroundColor: 'brand.white'
}
},

td: {
'&:first-of-type': {
...stickyTable
}
}
}
}
};
Expand Down

0 comments on commit 15dbaea

Please sign in to comment.