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
Sticky table headers on universal listings #11798
base: main
Are you sure you want to change the base?
Sticky table headers on universal listings #11798
Conversation
Manage this branch in SquashTest this branch here: https://yhaooo11enhancement11705-stick-o07cy.squash.io |
@thibaudcolas or @laymonage - when possible, it might be good for you to look at this. I will try to do a review in the coming week or so but pinging as you may have thoughts. Thank you @yhaooo11 for preparing this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few suggestions from a code variable usage perspective.
|
||
thead { | ||
position: sticky; | ||
top: 140px; | ||
@include media-breakpoint-up(sm) { | ||
top: 70px; | ||
} | ||
background-color: theme('colors.surface-page'); | ||
z-index: 3; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not run this code locally yet but in general we should avoid hard-coded values and instead use variables.
We use this 70px
in lots of places, not sure on the best location for this variable but maybe we should add to client/tailwind.config.js
.
addBase({
/** Support for web components */
':root, :host': {
'--w-font-sans': fontFamily.sans.join(', '),
'--w-font-mono': fontFamily.mono.join(', '),
'--w-density-factor': '1',
++ '--w-header-height': '4.375rem', // 70px
Then we can update as below.
thead { | |
position: sticky; | |
top: 140px; | |
@include media-breakpoint-up(sm) { | |
top: 70px; | |
} | |
background-color: theme('colors.surface-page'); | |
z-index: 3; | |
} | |
thead { | |
position: sticky; | |
top: calc(var(--w-header-height) * 2); | |
@include media-breakpoint-up(sm) { | |
top: var(--w-header-height); | |
} | |
background-color: theme('colors.surface-page'); | |
z-index: calc(theme('zIndex.header') - 20); // not sure on this but start here and see what works | |
} |
Makes table headers sticky for tables with the
full-width
class.This should implement the enhancement for the issue #11705