We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With types
Related: #129
The text was updated successfully, but these errors were encountered:
We have a proposal in #659 that adds ScaleValue and PropertyValue utilities.
ScaleValue
PropertyValue
The ScaleValue utility types a value to accept any token value from a given scale.
The PropertyValue utility types a value to accept any token or css value from a given property.
import * as Stitches from '@stitches/react' export const c = (value: Stitches.ScaleValue<'colors'>) => ({ color: value, }) export const mx = (value: Stitches.PropertyValue<'marginLeft'> | Stitches.PropertyValue<'marginLeft'>[]) => Array.isArray(value) ? { marginLeft: value[0], marginRight: value[1] || value[0] } : { marginLeft: value, marginRight: value }
import { createCss } from '@stitches/react' import * as utils from './utils' const { styled } = createCss({ theme: { colors: { red: '#ff0000', }, }, utils, }) const Button1 = styled('button', { c: '$red', mx: 'auto' }) const Button2 = styled('button', { c: '$red', mx: ['auto', 0] })
Sorry, something went wrong.
Fixed in V1. Please refer to migration guide and changelog
jonathantneal
peduarte
No branches or pull requests
With types
Related: #129
The text was updated successfully, but these errors were encountered: