-
fabdabe: ## Changes
When using
strictTokens: true
, if you didn't havetokens
(orsemanticTokens
) on a givenToken category
, you'd still not be able to use any values in properties bound to that category. Now,strictTokens
will correctly only restrict properties that have values in their token category.Example:
// panda.config.ts export default defineConfig({ // ... strictTokens: true, theme: { extend: { colors: { primary: { value: 'blue' }, }, // borderWidths: {}, // ⚠️ nothing defined here }, }, })
// app.tsx css({ // ❌ before this PR, TS would throw an error as you are supposed to only use Tokens // even thought you don't have any `borderWidths` tokens defined ! // ✅ after this PR, TS will not throw an error anymore as you don't have any `borderWidths` tokens // if you add one, this will error again (as it's supposed to) borderWidths: '123px', })
- Simplify typings for the style properties.
- Add the
csstype
comments for each property.
You will now be able to see a utility or
csstype
values in 2 clicks !Instead of relying on TS to infer the correct type for each properties, we now just generate the appropriate value for each property based on the config.
This should make it easier to understand the type of each property and might also speed up the TS suggestions as there's less to infer.
-
84304901: Improve performance, mostly for the CSS generation by removing a lot of
postcss
usage (and plugins).- Introduce a new
config.lightningcss
option to uselightningcss
(currently disabled by default) instead ofpostcss
. - Add a new
config.browserslist
option to configure the browserslist used bylightningcss
. - Add a
--lightningcss
flag to thepanda
andpanda cssgen
command to uselightningcss
instead ofpostcss
for this run.
markImportant
fn from JS instead of walking through postcss AST nodes- use a fork of
stitches
stringify
function instead ofpostcss-css-in-js
to write the CSS string from a JS object - only compute once
TokenDictionary
properties - refactor
serializeStyle
to use the same code path as the rest of the pipeline withStyleEncoder
/StyleDecoder
and rename it totransformStyles
to better convey what it does
- Introduce a new
- dfb3f85f: Add missing svg props types
-
24e783b3: Reduce the overall
outdir
size, introduce the new configjsxStyleProps
option to disable style props and further reduce it.config.jsxStyleProps
:- When set to 'all', all style props are allowed.
- When set to 'minimal', only the
css
prop is allowed. - When set to 'none', no style props are allowed and therefore the
jsxFactory
will not be usable as a component:<styled.div />
andstyled("div")
aren't valid- but the recipe usage is still valid
styled("div", { base: { color: "red.300" }, variants: { ...} })
-
6d4eaa68: Refactor code
- 54a8913c: Fix issue where patterns that include css selectors doesn't work in JSX
- efd79d83: Baseline release for the launch
-
fb40fff2: Initial release of all packages
- Internal AST parser for TS and TSX
- Support for defining presets in config
- Support for design tokens (core and semantic)
- Add
outExtension
key to config to allow file extension options for generated javascript..js
or.mjs
- Add
jsxElement
option to patterns, to allow specifying the jsx element rendered by the patterns.