question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add fontWeight to theme

See original GitHub issue

Follow up issue from #311

@broccolini how does this look for structure? Are there any other font weights we want to include?

fontWeight: {
 bold: '600',
 normal: '400'
}
  • Update any instances where fontWeight is hard coded

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
broccolinicommented, Oct 25, 2018

I talked with @emplums about this yesterday, I’m not sure we should support semibold in the theme because this should not be used. A few years ago when we introduced system fonts, we reduced the amount of font variations significantly, and made bold lighter and removed semibold instances. I think there are still some instances of semibold but it’s not a weight we should promote.

I agree that we should let people use number values too so they could still override, but with props I’d prefer to only have strings for the ones we want to promote.

Related, we only support font-weight: 300 for font sizes 20px and above because light weight fonts reduce readability. It would be great if we can warn folks on this type of thing if possible.

1reaction
shawnbotcommented, Oct 22, 2018

@colebemis not a dumb question! They can be numbers, and I think that the values in the fontWeights theme key should be:

{
  fontWeights: {
    light: 300,
    normal: 400,
    semibold: 500,
    bold: 600
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Theme.json typography: Line height, font weight and text ...
In this lesson I bring up the theme.json font style settings as well as line height, font weight and text decoration settings.
Read more >
font-weight - CSS: Cascading Style Sheets - MDN Web Docs
The font-weight CSS property sets the weight (or boldness) of the font. The weights available depend on the font-family that is currently ...
Read more >
How to add custom font weights to Material UI? - Stack Overflow
Trying to configure Material theme to use my own font and custom font weights/sizes for the Typography components. For the fontWeight ...
Read more >
Typography - MUI System
Documentation and examples for common text utilities to control alignment, wrapping, weight, and more.
Read more >
Font Weight - Tailwind CSS
By default, Tailwind provides nine font-weight utilities. You change, add, or remove these by editing the theme.fontWeight section of your Tailwind config.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found