Replies: 1 comment 2 replies
-
|
Hi! Thanks for the discussion. We purposely rely on getComputedStyle to avoid bundling a heavy, complex parser to handle things like variables, calc, and viewport units. Updating this logic would be a breaking change requiring us to build a new hook and deprecate the old one. Since this is essentially a fallback utility and not part of the core functionality, we don't have plans to change this behavior in the near future. Your best bet here is to implement a custom hook on your end per platform to handle the web variable parsing. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
currently useCSSVariables makes little sense and can't be used on multiple platform app.
it return a different type based on platform.
for
useCSSVariable("--spacing-4")on native i get a number
16on web i get a string
16pxsince we don't want to add a class to handle the headerHeight in uniwind.
I get a custom layout hook to calculate the header and add it to the paddingTop but now then because of the inconsistency of
useCSSVariablesi can't do that on web or i would need to parse the output myself, which i find bad.what would be your recommendation for this case? since i'm guessing you made the choice to have
useCSSVariableschange the return type per platform and not have it consistent :/Beta Was this translation helpful? Give feedback.
All reactions