Font Styles not getting applied by default #2035
-
I have defined my theme.config like this.
By default, the background and text colors are applied on every component in my app but the fonts are not. Where should I place these fonts to have them applied by defaul? EDIT: The only answer I found says to used |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The Other things can grab these tokens from scales and use them. As you noticed, import { Heading } from "theme-ui";
<Heading>Woop</Heading>; // uses fontFamily: "heading" internally
<Heading as="h3" sx={{ fontFamily: "subHeading" }}>
And we can use previously defined tokens in "sx" prop.
</Heading>; |
Beta Was this translation helpful? Give feedback.
The
"fonts"
property in the theme is a scale. This is where you define design tokens — you prepare ingredients for later use.Other things can grab these tokens from scales and use them.
As you noticed,
body
styles we apply usecolors.background
, but you can use these scales yourself withsx
prop and variants.