Closed dugip closed 1 year ago
@Mokshit06 Any thoughts on this one? I might be able to support with a PR, but I'd like to see what you're thinking about this one.
Thanks for reporting this. That is in fact an issue with the docs, rather than just being style={ [colorVar]: val }
it should be style={assignInlineVars({ [colorVar]: val })}
as shown here in vanilla-extract docs https://vanilla-extract.style/documentation/packages/dynamic/#assigninlinevars
@Mokshit06 Macaron doesn't export this function. It seems like it comes from @vanilla-extract/dynamic
. Could you please make a release that exports it?
Released in v1.2.0!
Talking about this page here: https://macaron.js.org/docs/dynamic-styling
It claims that
colorVar
would produce a string like--my-var
, but instead it producesvar(--my-var)
, which when passed as a style prop, would result in:Which is obviously wrong and wont work.
To fix this,
createVar
should return only the variable name without thevar()
wrap, perhaps something like: