News for hackers. Stuff that matters.
Re:StyleX – Meta's styling library by naman34 on Tuesday December 05, 2023 @11:56PM (#38540593)
Hey! We support dynamic styles, too.

We're continuing to work on optimisations for StyleX, and I'll be looking at Tamagui for inspiration!

Re:StyleX – Meta's styling library by nwienert on Wednesday December 06, 2023 @04:56AM (#38542118)
I got the impression it was not dynamic values? Just that you can combine static objects dynamically. If I’m wrong I’ll re read the docs but someone else pointed that out to me and linked part of the docs that seemed to indicate that.
Re:StyleX – Meta's styling library by blsapologist42 on Wednesday December 06, 2023 @11:28AM (#38546038)
It does support dynamic values.
Re:StyleX – Meta's styling library by nwienert on Wednesday December 06, 2023 @07:54PM (#38551547)
Can you link me to how you know that? The docs seem to indicate it doesn't:

"Since StyleX depends on ahead-of-time compilation, it is important for all your styles to be statically analyzable"

"No runtime style injection."

"All styles are bundled in a static CSS file at compile-time."

---

By dynamic styles I assume we're talking about something like this:

{ backgroundColor: props.thirdPartyColor ?? randomColor() }

Re:StyleX – Meta's styling library by naman34 on Thursday December 07, 2023 @06:09PM (#38563059)
Re:StyleX – Meta's styling library by nwienert on Thursday December 07, 2023 @08:27PM (#38564252)
Cool, thanks Naman. It’s really great work overall, congrats on the launch. Maybe those couple places could have wording that indicates it supports dynamic as well.