Replies: 1 comment 3 replies
-
|
Asking LLMs to analyse the source code and the tests I could figure out how to use inline styles: const sidebarStyles = stylex.create({
root: (width) => ({
width: width, // Dynamic value passed at runtime
backgroundColor: 'blue', // Static value compiled to CSS
}),
});But why is it so hidden? The full documentation is trying to hide this. This is a very much realistic need, please don't hide it. Also, how do you implement truly user customizable apps in StyleX? For example, user configurable sidebar width? |
Beta Was this translation helpful? Give feedback.
3 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.
Uh oh!
There was an error while loading. Please reload this page.
-
I don't understand how to load external constants into StyleX vars. I mean it's totally natural to need it, for example in an Electron app, I want to share SIDEBAR_WIDTH between main and renderer, so I put this variable in
shared/constant.ts.Also, there are million other cases where one needs to share a constant between a JS logic and a CSS / StyleX value.
Currently, StyleX really doesn't allow this. I tried many combinations of files, imports, etc, but it just doesn't want me to do this.
For example, this is inside a tokens.stylex.ts, but the same message appears when I use it in a component as well.
How do I solve this?
Beta Was this translation helpful? Give feedback.
All reactions