Skip to content

Conversation

JayGeorge
Copy link

@JayGeorge JayGeorge commented Aug 29, 2025

This fixes table border-radius for Firefox, along with a hover state adjustment.
It also improves things for Safari.
This closes #12070

Firefox

In Firefox’s implementation, tbody’s background and border properties aren’t rendered as a box, so border-radius has no visual effect.
Instead, I've styled the tds.

Safari

Similar to Firefox, in WebKit (Safari), any background, borders, or box-shadow applied to tbody are simply ignored — the browser paints only the table itself and its cells. Instead, our only option is to style the tds with borders instead of shadows. I've added an alternative shadow for browsers like Chrome to compensate for the new border.

…adjustment.

In Firefox’s implementation, tbody’s background and border properties aren’t rendered as a box, so your border-radius has no visual effect. Instead we need to style the tds
Similar to Firefox, tbody’s properties aren’t rendered as a box, so your box-shadows have no visual effect. Instead we need to style the tds with borders instead of shadows. I've added an alternative shadow for browsers like Chrome to compensate for the border
@JayGeorge JayGeorge changed the base branch from 5.x to master August 29, 2025 16:54
@jasonvarga
Copy link
Member

Does shadow-sm-b need to be added? It looks pretty much identical to shadow-sm.

@JayGeorge
Copy link
Author

JayGeorge commented Sep 1, 2025

@jasonvarga because I've added a hairline border around the whole table, if we use the existing shadow-sm it'll make the top border look blurry as the shadow and border overlap, which looks a little dirty.

shadow-sm-b is visually the same but pulls the shadow downwards ("shadow small bottom"), so the top border looks nice and clean.

Short answer… yes, please! Unfortunately, stock Tailwind doesn't have directional shadows, which is why I added it 😃

@jasonvarga
Copy link
Member

Ah I was going to point out the shadow is different to how it was anyway and that there's a border now. But if it's intentional cool 😄

@jasonvarga jasonvarga merged commit fd2b27b into master Sep 4, 2025
21 checks passed
@jasonvarga jasonvarga deleted the table-fixes-for-firefox branch September 4, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[6.x] Table overflow issue in Firefox and Safari
2 participants