Replies: 1 comment 6 replies
-
hey, can you give a bit more informations as to what you're trying to achieve ? you could get the raw value directly in the browser using |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
When a token or semantic token is defined as a reference to another token or semantic token, it appears that there is no way to retrieve the actual underlying color value. It looks like the
token
function is only doing one level of "dereferencing", but there are scenarios where it's necessary to have the underlying raw color value (e.g. hex), so given how the docs at https://panda-css.com/docs/theming/usage#style-attribute are written I was expectingtoken
to do as many dereferencing steps as necessary to get to the actual underlying color value.To get more concrete... In the playground I have
hex
andsemanticHex
tokens that have a hex value defined, and then I havereference
andsemanticReference
tokens that refer to their hex counterpart. In the React component I then print bothtoken()
andtoken.var()
output for each of these four. You can see thattoken()
appears to return the underlying value only down one level, so the hex tokens produce a hex value and the reference tokens produce the CSS variable for the hex token. I would expecttoken()
to return a hex value for both, by following the chain to get the hex value for the hex token rather than stopping after a single dereference.Is there another way to get the underlying raw color value for tokens defined as references? Or is there a reason
token()
couldn't be changed to return the underlying raw value? Thanks!Link to Reproduction
https://play.panda-css.com/bNuMXWtXgN
Steps to reproduce
JS Framework
No response
Panda CSS Version
0.36.0
Browser
No response
Operating System
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions