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

Use box shadows instead of linear gradients to colorize tables #32348

Merged
merged 2 commits into from
Dec 11, 2020

Conversation

MartijnCuppens
Copy link
Member

@MartijnCuppens MartijnCuppens commented Dec 5, 2020

Closes #32266

Before: https://codepen.io/MartijnCuppens/pen/oNzxwZY
After: https://codepen.io/MartijnCuppens/pen/PoGNjpQ

Scroll fast to see the effect. Effect most noticeable in Safari & Chrome.

@septatrix
Copy link
Contributor

For me this only improves the experience marginally (Samsung Galaxy A51, Chrome 86) but the white unrendered sections are still very noticeable.

@septatrix
Copy link
Contributor

I may be missing something but why is it not possible to just set the --bs-table-bg as the background on the <table> element and just have the child elements use --bs-table-accent-bg as the normal background?

@MartijnCuppens
Copy link
Member Author

I may be missing something but why is it not possible to just set the --bs-table-bg as the background on the <table> element and just have the child elements use --bs-table-accent-bg as the normal background?

We use this technique so we can mix the striped/active/hover tables with our table variants https://getbootstrap.com/docs/5.0/content/tables/#variants

@septatrix
Copy link
Contributor

Okay I did not even realize this is now possible with v5, that sounds great. I guess some :before/:after trickery was already considered as does not work for some reason?

Copy link
Member

@mdo mdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very noticeable difference on Safari. Wondering if we need a full 9999px or if we could get away with something smaller?

@MartijnCuppens
Copy link
Member Author

Very noticeable difference on Safari. Wondering if we need a full 9999px or if we could get away with something smaller?

I used 9999px because it was also used in our CSS for .modal-scrollbar-measure. It 'll always be some kind of magic number and the lower we go, the more chance we run into issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linear gradients slow down (large) table rendering by a lot
4 participants