body font from theme not applying
See original GitHub issueDescribe the bug
I’m using gatsby-plugin-theme-ui (with gatsby-starter-default) and using the Styled
component from theme-ui and I’m not seeing the fonts change for any “body” components (div, p, etc). What’s strange is that the headings change just fine.
To Reproduce
Contents of my src/gatsby-plugin-theme-ui/index.js
:
import theme from "@theme-ui/preset-tailwind";
export default {
...theme,
fonts: {
...theme.fonts,
body: "Arial, sans-serif",
heading: "Arial, sans-serif"
},
};
Expected behavior
I would expect the body fonts to change when I change the body
key. As I mentioned the headings do change, so I’m not sure if I’m doing something wrong :\
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Word 2011: Changing theme does not change font for normal ...
I think I fixed it by modifying the "Normal" style in my document - for the font, I changed it to the "Theme...
Read more >Custom font isn't loading on custom theme for Material UI
But it isn't working. So I tried to customize the font using plain CSS. I found a workaround removing the overrides property in...
Read more >Body font size not working: Generatepress Theme
Hi, i m using generatepress theme free version and i m not able to change body font size by using theme>customize>typograpghy.
Read more >Child theme not working (body) - Support - Themeco Forum
Please navigate to Google Fonts, choose a category and choose an actual font. Then navigate to Theme Options > Typography > Body Font...
Read more >font-family - CSS: Cascading Style Sheets - MDN Web Docs
You should always include at least one generic family name in a font-family list, since there's no guarantee that any given font is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is the current behavior (the docs might not be super clear), but the next version will apply some typographic styles to the body element by default, with an option to disable that behavior
@jxnblk thanks for the reply, that makes sense.
So I tried removing
Styled.root
and just putting this in my theme file as documented, usingpreset-base
:but still no dice, the styles don’t even show up: