Tokens in importMap? #2127
-
Hey everyone, I'm using the config's importMap to make sure that the build step works correctly in my nx monorepo. The idea was to use this syntax in a style :
but it's not compiling the fontFamily rule. On the other hand, if I do it like this it works :
I'm guessing that it has to do with tokens mapping capability missing from the importMap. Is this by design? Am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
can you make a minimal repro ? |
Beta Was this translation helpful? Give feedback.
@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…