-
Somewhat relevant to #867. I am wondering if it's possible to do something like the following: // vars.stylex.ts
export const myVars = defineVars({
foo: stylex.types.color("red");
});
// Foo.ts
import { myVars } from "./vars.stylex.ts"
myVars.foo.type // "<color>" I know this doesn't work because So for example, maybe A couple of ideas: Expose something like the following:
Right now I simply suffix the name of the variable with the camel case name type such as Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
There is no runtime information about the type of the variable and I don't think we'd add it. The TS types already exist and you should able to write other types to leverage that. Can you give me a bit more detail on what you're trying to do?
If you need runtime information, you can always prefix your own variables or group them by type.
|
Beta Was this translation helpful? Give feedback.
There is no runtime information about the type of the variable and I don't think we'd add it. The TS types already exist and you should able to write other types to leverage that.
Can you give me a bit more detail on what you're trying to do?
If you need runtime information, you can always prefix your own variables or group them by type.
colorVars.foo
,lengthVar.foo
, etc.