4.2.0 • Published 6 years ago
@affectionatedoor/gatsby-theme-ui v4.2.0
gatsby-theme-ui
A basic configuration of theme-ui as a Gatsby theme. Also includes some useful components. In this link you can find examples.
Table of contents
Theme options
| Name | Description | Type | Default |
|---|---|---|---|
| imageDirectory | Images for sharp | string | src/images |
| pageDirectory | This exists to make mdx files available to GraphQL queries. | string | src/pages |
| logoFilename | Place the logo inside the imageDirectory. | string | gatsby-icon.png |
| gatsbyMdxConfig | You can't configure gatsby-plugin-mdx multiple times so with this option you can override it | object | See baseGatsbyMdxConfig in gatsby-config |
Add fonts
Say you want to use the Lora font, both for headings and body.
- Install the typeface package:
yarn add typeface-lora- Override (shadow) the theme's
fonts.jsby creating the following file atsrc/@affectionatedoor/gatsby-theme-ui/theme/fonts.js:
export default {
body: '"Lora", sans-serif',
heading: '"Lora", serif',
monospace: "Menlo, monospace"
};- Import the package at both
gatsby-ssr.jsandgatsby-browser.js:
import "typeface-lora";Change colors
If you want to change the colors or add a new color mode, shadow the src/theme/colors.js file.