Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/lowmess/lameass.recipes. A recipe site, but without the ads and 3,000 word essays lameass.recipes
nextjs sanity-io theme-ui typescript
Something went wrong. Try again.
1.3 kB · 59 lines
TypeScript
at develop
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960/* eslint-disable import/exports-last */import { useThemeUI, ThemeUIContextValue } from 'theme-ui'import { Theme, ThemeUICSSObject, ColorModesScale } from '@theme-ui/css'// primitivesimport colors from './colors'import space from './space'import { borders, radii } from './borders'import { fonts, fontSizes, fontWeights, lineHeights } from './typography'import sizes from './sizes'// variantsimport styles from './styles'import layout from './layout'import cards from './cards'import text from './text'import links from './links'import buttons from './buttons'import forms from './forms'
export type NestedThemeUICSSObject = { [k: string]: ThemeUICSSObject}
const makeTheme = <T extends Theme>(t: T) => t
const breakpoints = ['30em', '40em', '64em']
const theme = makeTheme({ // primitives breakpoints, colors, space, borders, radii, fonts, fontSizes, fontWeights, lineHeights, sizes, // variants styles, layout, cards, text, links, buttons, forms,})
export type ExactTheme = typeof theme & { rawColors?: ColorModesScale}
interface ExactContextValue extends Omit<ThemeUIContextValue, 'theme'> { theme: ExactTheme}
export const useTheme = useThemeUI as unknown as () => ExactContextValue
export default theme