Skip to content

Commit

Permalink
feat(table): fixed first column (#106)
Browse files Browse the repository at this point in the history
* feat(table): fixed first column

* feat(table): fixs from comments

* feat(table): fix style name

* feat(table): fixs from comments

* feat(table): fixs from comments
  • Loading branch information
malegreIndec authored Feb 8, 2024
1 parent 930cd78 commit da7efba
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions src/theme/components/table.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
const baseStyles = {
fontSize: '16px',
height: '35px',
table: {
background: 'brand.white',
borderRadius: '0 0 10px 10px'
}
};

const fixedFirstColumnStyles = {
position: 'sticky',
left: '0',
backgroundColor: 'brand.white'
};

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 +39,21 @@ const table = {
textAlign: 'left',
padding: '10px 20px'
}
},
fixedFirstColumn: {
...baseStyles,
tr: {
'th:first-of-type': fixedFirstColumnStyles,
'&: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': fixedFirstColumnStyles
}
}
}
};
Expand Down

0 comments on commit da7efba

Please sign in to comment.