Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(table): fixed first column #106

Merged
merged 5 commits into from
Feb 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = {
malegreIndec marked this conversation as resolved.
Show resolved Hide resolved
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'
}
},

malegreIndec marked this conversation as resolved.
Show resolved Hide resolved
fixedFirstColumn: {
...baseStyles,
tr: {
'& th:first-of-type': {
malegreIndec marked this conversation as resolved.
Show resolved Hide resolved
...stickyTable,
backgroundColor: 'brand.white'
},
'&:nth-of-type(even) td:first-of-type ': {
malegreIndec marked this conversation as resolved.
Show resolved Hide resolved
backgroundColor: 'brand.neutral50'
},
'&:nth-of-type(odd) td:first-of-type ': {
malegreIndec marked this conversation as resolved.
Show resolved Hide resolved
backgroundColor: 'brand.white'
}
},

malegreIndec marked this conversation as resolved.
Show resolved Hide resolved
td: {
'&:first-of-type': {
malegreIndec marked this conversation as resolved.
Show resolved Hide resolved
...stickyTable
malegreIndec marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}
};
Expand Down
Loading