Skip to content

Tokens in importMap? #2127

Closed Answered by anubra266
NickTsitlakidis asked this question in Q&A
Feb 1, 2024 · 1 comments · 5 replies

You must be logged in to vote

@NickTsitlakidis I took a look at your styles; the js token function call is a runtime function. It's not for use within panda methods. https://panda-css.com/docs/guides/dynamic-styling#using-token

While the token string function is mostly for use in composite values. E.g. border: solid 1px token(colors.red.300).
In your usecase, you should just do color: deepPurple.

In addition you can also define string tokens with curly braces.
border: solid 1px {colors.red.300}, the token string function is mostly so you can assign callbacks if the token does not exist:
border: solid 1px token(colors.red.300, red)
Our eslint plugin will stop you from using undefined tokens and also stop you from using…

Replies: 1 comment 5 replies

You must be logged in to vote
5 replies
@NickTsitlakidis

@anubra266

Answer selected by NickTsitlakidis
@NickTsitlakidis

@anubra266

@NickTsitlakidis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants