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

problematic line-height values #18

Open
danielgamage opened this issue May 12, 2022 · 0 comments
Open

problematic line-height values #18

danielgamage opened this issue May 12, 2022 · 0 comments
Labels
bug Something isn't working core Affects the core endpoint documentation Improvements or additions to documentation

Comments

@danielgamage
Copy link
Member

window.getComputedStyle doesn't always return a pixel value, particularly when it evaluates to normal.

style value getComputedStyle value
18px
inherit 18px
initial normal
normal normal
revert 18px
unset 18px

mechanical-ragger fails for this test case (since normal evaluates to NaN).

Error reading "core.ts:53 Uncaught RangeError: Invalid array length"

MDN suggests that the default is ~1.2, but chrome uses something closer to 1.16 🥴

normal

Depends on the user agent. Desktop browsers (including Firefox) use a default value of roughly 1.2, depending on the element's font-family.

https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#values

Either way, relying on all UAs to use a reliable default here feels risky, so maybe we should log a warning in the console and not try to render the exclusion if we can't figure out the line-height? and probably update the README to note this.

@danielgamage danielgamage added bug Something isn't working documentation Improvements or additions to documentation core Affects the core endpoint labels May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Affects the core endpoint documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant