Package Exports
- @theme-ui/css
- @theme-ui/css/dist/theme-ui-css.cjs.js
- @theme-ui/css/dist/theme-ui-css.esm.js
- @theme-ui/css/utils
- @theme-ui/css/utils/dist/theme-ui-css-utils.cjs.js
- @theme-ui/css/utils/dist/theme-ui-css-utils.esm.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@theme-ui/css) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@theme-ui/css
@theme-ui/css contains the framework-agnostic core logic of Theme UI. It lets
you write style objects with responsive, theme-aware ergonomic shortcuts.
npm i @theme-ui/css @emotion/reactUsage
import { css as transformStyleObject } from '@theme-ui/css'
import { css as createClassName } from '@emotion/css'
const root = document.getElementById('root')
/** @type {import("@theme-ui/css").Theme} */
const theme = {
colors: {
text: '#222',
},
fonts: {
mono: 'monospace',
},
space: {
sm: '1rem',
md: '2rem',
},
}
const styles = transformStyleObject({
padding: ['sm', 'md'],
border: ({ colors }) => `2px solid ${colors.text}`,
h1: {
fontFamily: 'mono',
color: 'text',
},
})(theme)
root.classList.add(createClassName(styles))
root.innerHTML = `
<h1>You can use <code>@theme-ui/css</code> in Vanilla JS!</h1>
`