Is there any way to give default fontfamily somewhere like theme?
Thanks
I tend to add a typography styled component to the root of an app since those CSS properties use inheritance. You can use styled-system to pick up fontFamily values from a theme if needed
Is there a quick example of what this looks like? Would the component add an extra dom element or can you style a react fragment?
@mrcoles Fragments don't render anything, so yeah, it'd have to be a <div> or other element – <div> is fine in this case since its only purpose is for styling and doesn't need to specify anything about the semantics of the content.
// example
const Root = styled('div')(props => ({
fontFamily: props.theme.fonts.body,
lineHeight: props.theme.lineHeights.body,
}))
Most helpful comment
@mrcoles Fragments don't render anything, so yeah, it'd have to be a
<div>or other element –<div>is fine in this case since its only purpose is for styling and doesn't need to specify anything about the semantics of the content.