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

[Bug] Invalid line-height CSS property for StyledTable #5362

Closed
Eta0 opened this issue Dec 5, 2024 · 1 comment · Fixed by #5363
Closed

[Bug] Invalid line-height CSS property for StyledTable #5362

Eta0 opened this issue Dec 5, 2024 · 1 comment · Fixed by #5363
Assignees
Labels

Comments

@Eta0
Copy link

Eta0 commented Dec 5, 2024

Invalid StyledTable line-height

The default line-height CSS property defined for a StyledTable uses an invalid calc expression, causing it to be ignored in most browsers.

line-height: calc(20 / var(--table-font-size));

(Nearby, --table-font-size is defined as 0.75rem, so this ends up as calc(20 / 0.75rem)).

Due to a bug in Chromium (seemingly fixed in commit chromium/chromium@9928efc), for some newer Chromium builds, this was briefly not ignored, and resulted in illegibly short lines. This property should be removed or changed to a more correct default like line-height: 1.5.

Interestingly, this exact calculation was added as a test case as an example of an invalid calc expression in the Chromium source tree (calc(20 / 0.75rem)), possibly motivated by this CSS snippet, so that should serve as quick proof that this line is currently not correct:

assert_invalid_value("margin-left", "calc(20 / 0.75rem)", // invalid calc expression
                     "division by non-number");
@joshblack
Copy link
Member

Hi there, @Eta0! Thanks so much for taking the time to make this issue, it was incredibly helpful 🙏 Opened up what I hope will be a fix for this over in: #5363 so that we're no longer dividing by that rem value.

Thanks again!

@joshblack joshblack self-assigned this Dec 5, 2024
@joshblack joshblack added bug Something isn't working component: DataTable labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants