Global styles
The first thing we will do is create global styles. These are styles that apply site-wide. They should be added to the root component of your theme.
We'll change the font to be sans-serif throughout our site. To do this let's import the <Global>
component and the css
function from Frontity into our root component file.
The <Global>
component has an attribute, styles
, which in turn takes a css
function as it's value.
When you save the file you should notice that the fonts on your site have now changed automatically to be sans-serif.
Next we'll look at the power and flexibility that styled components give us.
Last updated