How to use @theme-ui/css - 4 common examples

To help you get started, we’ve selected a few @theme-ui/css examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github system-ui / theme-ui / packages / color-modes / src / index.js View on Github external
const applyColorMode = (theme, mode) => {
  if (!mode) return theme
  const modes = get(theme, 'colors.modes', {})
  return merge.all({}, theme, {
    colors: get(modes, mode, {}),
  })
}
github system-ui / theme-ui / packages / mdx / src / index.js View on Github external
export const themed = key => props =>
  css(get(props.theme, `styles.${key}`))(props.theme)
github system-ui / theme-ui / packages / color-modes / src / index.js View on Github external
const applyColorMode = (theme, mode) => {
  if (!mode) return theme
  const modes = get(theme, 'colors.modes', {})
  return merge.all({}, theme, {
    colors: get(modes, mode, {}),
  })
}
github system-ui / theme-ui / packages / core / src / index.js View on Github external
return theme => {
    const styles = css(props.sx)(theme)
    const raw = typeof props.css === 'function' ? props.css(theme) : props.css
    return [styles, raw]
  }
}

@theme-ui/css

[![Minified Size on Bundlephobia](https://badgen.net/bundlephobia/minzip/@theme-ui/css)](https://bundlephobia.com/package/@theme-ui/css)

MIT
Latest version published 14 days ago

Package Health Score

95 / 100
Full package analysis

Popular @theme-ui/css functions

Similar packages