Theme-ui: no body fonts changes

Created on 10 Apr 2020  路  3Comments  路  Source: system-ui/theme-ui

fonts: {
    heading: '"Courier",
    body: '"Courier"
  },

Headers are Courier
Body is notCourier

Most helpful comment

This is from that page, linked in @dburles comment above:

styles: {
    root: {
      // uses the theme values provided
      fontFamily: "body",
      fontWeight: "body",
    },
  },

This got me too - perhaps explaining why some values automatically get added to the body and the why the fonts don't should be in the documentation, Including on the Gatsby site: https://www.gatsbyjs.org/docs/theme-ui/

Looking at the page on theming it seems that the base for theme-ui uses the above theme.styles.root to already set font-family and other styles, but not things like background colour. Out of the box this made me a quite confused!

All 3 comments

You just need to add it to the root object in the theme https://theme-ui.com/theming#body-styles

This is from that page, linked in @dburles comment above:

styles: {
    root: {
      // uses the theme values provided
      fontFamily: "body",
      fontWeight: "body",
    },
  },

This got me too - perhaps explaining why some values automatically get added to the body and the why the fonts don't should be in the documentation, Including on the Gatsby site: https://www.gatsbyjs.org/docs/theme-ui/

Looking at the page on theming it seems that the base for theme-ui uses the above theme.styles.root to already set font-family and other styles, but not things like background colour. Out of the box this made me a quite confused!

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vojtaholik picture vojtaholik  路  3Comments

folz picture folz  路  3Comments

Everspace picture Everspace  路  3Comments

tesseralis picture tesseralis  路  3Comments

VinSpee picture VinSpee  路  3Comments