getComputedStyle() does not respect the Fallback weights algorithm #22496
Labels
Content:CSS
Cascading Style Sheets docs
effort: small
This task is a small effort.
help wanted
If you know something about this topic, we would love your help!
MDN URL
https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
What specific section or headline is this issue about?
No response
What information was incorrect, unhelpful, or incomplete?
There is missing information that
getComputedStyle()
on an element with a weight style which the font does not support actually does not return the real shown font weight but the weight style number thus not reflecting the result of the Fallback weights algorithm.What did you expect to see?
A warning that
getComputedStyle()
has unintuitive behavior regarding font weight (especially surprising when one uses a variable font which supports "infinite" range of weights like Inter).Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
Hacky test code changing font weight based on font size:
MDN metadata
Page report details
en-us/web/css/font-weight
The text was updated successfully, but these errors were encountered: