-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add font weight picking mechanism #24978
Conversation
Size Change: +451 B (0%) Total Size: 1.21 MB
ℹ️ View Unchanged
|
Hmmm inherit & initial are OK as words, but the rest of them IMO should not be available both as numeric values and text... Bold is the same as 700 in most cases, or at least that is the CSS convention.
Tricky topic. |
d693011
to
ac1c4b2
Compare
55fb05d
to
162c293
Compare
076a982
to
deb24da
Compare
I was thinking about this one this weekend... It's something we'll definitely need, but then I realized that we may need 2 controls implementations for this! If I'm using a variable font-family on my site and have found that a font-weight of 350 is what I need for my design, then 300 or 400 will be close, but not quite right. So the dropdown won't do in that case, I'd need a slider - otherwise I'd have to resort to writing custom CSS for that 🤔 |
Couldn't choosing the font weight be similar to choosing font size for consistency? We could have a set of registered weights, optionally with names, per font family. And then there could be a dropdown for custom weights. Custom weights could be disabled by the theme completely, just like for font sizes. Custom weights could be restricted or a range if it is a variable font? Also, I am not sure either whether using inherit and initial (and too much options) are useful for average users (however they are defined). |
b6d1fcb
to
081494a
Compare
c37a813
to
cd5a2cf
Compare
Closed in favor of #26444. |
This PR adds a font-weight picking mechanism.
The mechanism is very simple and allows to use all valid CSS values for font-weight. Themes can disable font-weight picking via theme.json or set default values there.
Question: Should themes be able to restrict what font weights are available? If yes, should the restriction be dependent on a font family?
Screenshots