Skip to content

[css-fonts-5] Consider making font-weight: bolder (and lighter) font-specific #6847

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

Open
litherum opened this issue Dec 1, 2021 · 3 comments

Comments

@litherum
Copy link
Contributor

litherum commented Dec 1, 2021

Consider a font family with a weight=300 member and a weight = 600 member. Consider the following content:

<div id="outer" style="font: 300 16px MyFontFamily;">
    <div id="inner" style="font-weight: bolder;">...</div>
</div>

The definition of bolder says that the computed weight for inner would be 400. According to the font matching rules, if the requested weight is 400, a candidate font of weight 300 would be chosen rather than another candidate of weight 600.

This means that, for the inner element, the author has requested a bolder weight, but they didn't get one, even though a bolder weight exists.

Maybe bolder should take into account which members of the family are present, so this situation would match the weight=600 font rather than the weight=300 font.

@dbaron
Copy link
Member

dbaron commented Dec 1, 2021

It's worth noting that bolder and lighter used to be defined this way, but we decided to change to the current definition. I don't recall all of the reasoning (although there was certainly a bunch of complexity around the computed values, since they had to represent "3 weights lighter than 800", etc.), but it's probably worth going through the discussions leading to that switch.

@litherum
Copy link
Contributor Author

@jfkthame @drott

@svgeesus
Copy link
Contributor

IIRC in the past we argued that bolder and lighter are blunt instruments and that if content authors really care what they get, they should specify (or calculate) explicit weights.

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

No branches or pull requests

4 participants