@webstackbuilders/theme-preset-website
Version:
Common Theme UI template for the Webstack Builders company website
110 lines (106 loc) • 2.1 kB
text/typescript
/*
* Theme UI template theme
*/
// @TODO: Can this could be refactored to turn this package into a Gatsby plugin, and
// the Prisma code highlighting added as the `prismPreset` option to the `gatsby-config.js`
// file here for the `gatsby-plugin-theme-ui` plugin?
import vsDark from '@theme-ui/prism/presets/vs-dark.json'
const heading = {
color: 'text',
fontFamily: 'heading',
lineHeight: 'heading',
fontWeight: 'heading',
}
const baseThemeTemplate = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
fonts: {
body: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',
heading: 'inherit',
monospace: 'Menlo, monospace',
},
fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 96],
fontWeights: {
body: 400,
heading: 700,
bold: 700,
},
lineHeights: {
body: 1.5,
heading: 1.125,
},
colors: {
text: '#000',
heading: '#07c',
background: '#fff',
primary: '#07c',
secondary: '#30c',
muted: '#f6f6f6',
},
styles: {
root: {
fontFamily: 'body',
lineHeight: 'body',
fontWeight: 'body',
},
h1: {
...heading,
fontSize: 5,
},
h2: {
...heading,
fontSize: 4,
},
h3: {
...heading,
fontSize: 3,
},
h4: {
...heading,
fontSize: 2,
},
h5: {
...heading,
fontSize: 1,
},
h6: {
...heading,
fontSize: 0,
},
p: {
color: 'text',
fontFamily: 'body',
fontWeight: 'body',
lineHeight: 'body',
},
a: {
color: 'primary',
},
pre: {
fontFamily: 'monospace',
overflowX: 'auto',
code: {
color: 'inherit',
},
},
code: {
...vsDark,
},
table: {
width: '100%',
borderCollapse: 'separate',
borderSpacing: 0,
},
th: {
textAlign: 'left',
borderBottomStyle: 'solid',
},
td: {
textAlign: 'left',
borderBottomStyle: 'solid',
},
img: {
maxWidth: '100%',
},
},
}
export = baseThemeTemplate