Borrows a lot from emotion/styled-components it appears. The extensive typing seems to be the biggest feature. They mention why I should choose it over BEM or Tailwind, why choose it over MUI though?
Does anyone really like Material UI? I find it so clunky and heavy.
StyleX – Meta's styling library
81–86 of 86 posts
Re: StyleX – Meta's styling library
#82React is one of these things that was designed to be unbeareable tonuse without custom syntax, but at least it is possible . This looks looks like it does not work without custom syntax at all. Type safety is a nice to have, but it should not need an exotic compiler plugin.
Re: StyleX – Meta's styling library
#83Earlier quoted context omitted.
Announced at React Conf 2018, I was so hyped for it back then! I did not expect it to take 5 years. https://youtu.be/9JZHodNR184?t=270
We should keep this in mind and adapt our expectations about forget, the compiler that they announced like one year ago
Re: StyleX – Meta's styling library
#84Earlier quoted context omitted.
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.
It does support dynamic values.
"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
#85Earlier quoted context omitted.
It does support dynamic values.
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
#86Earlier quoted context omitted.
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() }
https://stylexjs.com/docs/learn/styling-ui/defining-styles/#...