🐼 Panda v0.36.0 #2407
anubra266
announced in
Announcements
🐼 Panda v0.36.0
#2407
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To upgrade to v0.36.0:
What's Changed
Fixed
Fix
Expression produces a union type that is too complex to represent
withsplitCssProps
because ofJsxStyleProps
typeFix merging issue when using a preset that has a token with a conflicting value with another (or the user's config)
When merged with the preset, the config would create nested tokens (
black.10
,black.20
,black.30
) inside of theinitially flat
black
token.This would cause issues as the token engine stops diving deeper after encountering an object with a
value
property.To fix this, we now automatically replace the flat
black
token using theDEFAULT
keyword when resolving the configso that the token engine can continue to dive deeper into the object:
strictPropertyValues
typings should allow forCssVars
(either predefined fromglobalVars
or any custom CSSvariable)
If no
globalVars
are defined, anyvar(--*)
will be allowedAdded
globalVars
config option to define type-safeCSS variables and custom
CSS @property.
Example:
config.themes
to easily define and apply a theme on multiple tokens at once, using data attributes and CSSvariables.
Can pre-generate multiple themes with token overrides as static CSS, but also dynamically import and inject a theme
stylesheet at runtime (browser or server).
Example:
Pregenerating themes
By default, no additional theme variant is generated, you need to specify the specific themes you want to generate in
staticCss.themes
to include them in the CSS output.This will generate the following CSS:
An alternative way of applying a theme is by using the new
styled-system/themes
entrypoint where you can import thethemes CSS variables and use them in your app.
Each theme has a corresponding JSON file with a similar structure:
Dynamically import a theme using its name:
Inject the theme styles into the DOM:
SSR example with NextJS:
Finally, you can create a theme contract to ensure that all themes have the same structure:
Cbanged
When using
strictTokens: true
, if you didn't havetokens
(orsemanticTokens
) on a givenToken category
, you'dstill not be able to use any values in properties bound to that category. Now,
strictTokens
will correctly onlyrestrict properties that have values in their token category.
Example:
Description
csstype
comments for each property.You will now be able to see a utility or
csstype
values in 2 clicks !How
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.
Beta Was this translation helpful? Give feedback.
All reactions