@pandacss/token-dictionary@0.25.0
版本发布时间: 2024-01-06 19:07:17
chakra-ui/panda最新发布版本:@pandacss/types@0.46.0(2024-09-10 02:16:05)
Minor Changes
-
de282f60: Support token reference syntax when authoring styles object, text styles and layer styles.
import { css } from '../styled-system/css' const styles = css({ border: '2px solid {colors.primary}', })
This will resolve the token reference and convert it to css variables.
.border_2px_solid_\{colors\.primary\} { border: 2px solid var(--colors-primary); }
The alternative to this was to use the
token(...)
css function which will be resolved.token(...)
vs{...}
Both approaches return the css variable
const styles = css({ // token reference syntax border: '2px solid {colors.primary}', // token function syntax border: '2px solid token(colors.primary)', })
However, The
token(...)
syntax allows you to set a fallback value.const styles = css({ border: '2px solid token(colors.primary, red)', })
Patch Changes
- Updated dependencies [59fd291c]
- @pandacss/types@0.25.0
- @pandacss/shared@0.25.0