|
| 1 | +const heading = { |
| 2 | + fontFamily: 'heading', |
| 3 | + fontWeight: 'heading', |
| 4 | + lineHeight: 'heading' |
| 5 | +} |
| 6 | + |
| 7 | +// Based on theme-ui/swiss with different colors |
| 8 | +export const theme = { |
| 9 | + breakpoints: ['30em', '48em', '80em'], |
| 10 | + colors: { |
| 11 | + text: 'hsl(165, 20%, 20%)', |
| 12 | + background: 'hsl(190, 10%, 98%)', |
| 13 | + primary: 'hsl(165, 60%, 30%)', |
| 14 | + secondary: 'hsl(125, 80%, 35%)', |
| 15 | + highlight: 'hsl(114, 40%, 90%)', |
| 16 | + muted: 'hsl(165, 20%, 94%)', |
| 17 | + gray: 'hsl(165, 20%, 75%)', |
| 18 | + purple: 'hsl(250, 60%, 30%)' |
| 19 | + }, |
| 20 | + fonts: { |
| 21 | + body: |
| 22 | + 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif', |
| 23 | + heading: 'inherit', |
| 24 | + monospace: 'Menlo, monospace' |
| 25 | + }, |
| 26 | + fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72], |
| 27 | + fontWeights: { |
| 28 | + body: 400, |
| 29 | + heading: 700, |
| 30 | + display: 900 |
| 31 | + }, |
| 32 | + lineHeights: { |
| 33 | + body: 1.5, |
| 34 | + heading: 1.25 |
| 35 | + }, |
| 36 | + textStyles: { |
| 37 | + heading, |
| 38 | + display: { |
| 39 | + variant: 'textStyles.heading', |
| 40 | + fontSize: [5, 6], |
| 41 | + fontWeight: 'display', |
| 42 | + letterSpacing: '-0.03em', |
| 43 | + mt: 3 |
| 44 | + } |
| 45 | + }, |
| 46 | + styles: { |
| 47 | + Container: { |
| 48 | + p: 3, |
| 49 | + maxWidth: 1024 |
| 50 | + }, |
| 51 | + root: { |
| 52 | + fontFamily: 'body', |
| 53 | + lineHeight: 'body', |
| 54 | + fontWeight: 'body' |
| 55 | + }, |
| 56 | + h1: { |
| 57 | + variant: 'textStyles.display' |
| 58 | + }, |
| 59 | + h2: { |
| 60 | + variant: 'textStyles.heading', |
| 61 | + fontSize: 5 |
| 62 | + }, |
| 63 | + h3: { |
| 64 | + variant: 'textStyles.heading', |
| 65 | + fontSize: 4 |
| 66 | + }, |
| 67 | + h4: { |
| 68 | + variant: 'textStyles.heading', |
| 69 | + fontSize: 3 |
| 70 | + }, |
| 71 | + h5: { |
| 72 | + variant: 'textStyles.heading', |
| 73 | + fontSize: 2 |
| 74 | + }, |
| 75 | + h6: { |
| 76 | + variant: 'textStyles.heading', |
| 77 | + fontSize: 1 |
| 78 | + }, |
| 79 | + a: { |
| 80 | + color: 'primary', |
| 81 | + '&:hover': { |
| 82 | + color: 'secondary' |
| 83 | + } |
| 84 | + }, |
| 85 | + pre: { |
| 86 | + variant: 'prism', |
| 87 | + fontFamily: 'monospace', |
| 88 | + fontSize: 1, |
| 89 | + p: 3, |
| 90 | + color: 'text', |
| 91 | + bg: 'muted', |
| 92 | + overflow: 'auto', |
| 93 | + code: { |
| 94 | + color: 'inherit' |
| 95 | + } |
| 96 | + }, |
| 97 | + code: { |
| 98 | + fontFamily: 'monospace', |
| 99 | + color: 'secondary', |
| 100 | + fontSize: 1 |
| 101 | + }, |
| 102 | + inlineCode: { |
| 103 | + fontFamily: 'monospace', |
| 104 | + color: 'secondary', |
| 105 | + bg: 'muted' |
| 106 | + }, |
| 107 | + table: { |
| 108 | + width: '100%', |
| 109 | + my: 4, |
| 110 | + borderCollapse: 'separate', |
| 111 | + borderSpacing: 0, |
| 112 | + 'th,td': { |
| 113 | + textAlign: 'left', |
| 114 | + py: '4px', |
| 115 | + pr: '4px', |
| 116 | + pl: 0, |
| 117 | + borderColor: 'muted', |
| 118 | + borderBottomStyle: 'solid' |
| 119 | + } |
| 120 | + }, |
| 121 | + th: { |
| 122 | + verticalAlign: 'bottom', |
| 123 | + borderBottomWidth: '2px' |
| 124 | + }, |
| 125 | + td: { |
| 126 | + verticalAlign: 'top', |
| 127 | + borderBottomWidth: '1px' |
| 128 | + }, |
| 129 | + hr: { |
| 130 | + border: 0, |
| 131 | + borderBottom: '1px solid', |
| 132 | + borderColor: 'muted' |
| 133 | + }, |
| 134 | + img: { |
| 135 | + maxWidth: '100%' |
| 136 | + } |
| 137 | + }, |
| 138 | + prism: { |
| 139 | + '.comment,.prolog,.doctype,.cdata,.punctuation,.operator,.entity,.url': { |
| 140 | + color: 'gray' |
| 141 | + }, |
| 142 | + '.comment': { |
| 143 | + fontStyle: 'italic' |
| 144 | + }, |
| 145 | + '.property,.tag,.boolean,.number,.constant,.symbol,.deleted,.function,.class-name,.regex,.important,.variable': { |
| 146 | + color: 'purple' |
| 147 | + }, |
| 148 | + '.atrule,.attr-value,.keyword': { |
| 149 | + color: 'primary' |
| 150 | + }, |
| 151 | + '.selector,.attr-name,.string,.char,.builtin,.inserted': { |
| 152 | + color: 'secondary' |
| 153 | + } |
| 154 | + } |
| 155 | +} |
| 156 | + |
| 157 | +export default theme |
0 commit comments