@pandacss/error
Advanced tools
Changelog
[0.25.0] - 2024-01-06
base
doesn't work within css functioncss({
// This didn't work, but now it does
base: { color: 'blue' },
})
import { defineConfig } from '@pandacss/dev'
export default defineConfig({
// ...
staticCss: {
recipes: '*', // ✅ will generate the staticCss for all recipes
},
})
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)',
})