Live data from Hacker News

StyleX – Meta's styling library

stylexjs.com

21–30 of 86 posts

Re: StyleX – Meta's styling library

#22
post #6

Just at a cursory glance, this looks pretty verbose and clunky. Existing React ecosystem styling solutions are many, so it’s not immediately evident to me when you would accept the trade offs introduced by this tool over any existing ones that seem much nicer to not only integrate, but also have to work with day to day.

0 runtime is the argument over emotion (and therefore MUI right now)

thanks for pointing this out. I hope they extend their `thinking in stylex` page with this info.

Re: StyleX – Meta's styling library

#23

I hate having to give everything a name like people do in react native stylesheets. Give me an inline performant style prop any day

You already have to name your CSS classes, and atomic CSS libraries are chock full of names you must learn.

What do you mean "inline style prop," writing CSS in the HTML style attribute? That's a nightmare to manage across large apps, not composable or reusable, and this library compiles to performant styling (according to the authors/examples).

Re: StyleX – Meta's styling library

#25
post #4

How does this compare to https://griffel.js.org/ ?

Great question, this strikes me as very similar.

This appears to place more emphasis on static typing, and has less strange syntax (think of "shorthand" in Griffel).

The docs steer you away from atomic CSS, whereas Griffel's embraces them.

Re: StyleX – Meta's styling library

#26
post #10
post #6

Just at a cursory glance, this looks pretty verbose and clunky. Existing React ecosystem styling solutions are many, so it’s not immediately evident to me when you would accept the trade offs introduced by this tool over any existing ones that seem much nicer to not only integrate, but also have to work with day to day.

it was exciting at launch, but took forever to ship, and now Tailwind has run away with that problem.

Agreed! It’s been used internally at Meta for so long, but I don’t miss it after adopting Tailwind.

Re: StyleX – Meta's styling library

#27

I hate having to give everything a name like people do in react native stylesheets. Give me an inline performant style prop any day

Inline styles by themselves don't support a lot of necessary CSS things like media and child selectors. You lose the "cascading" part of CSS...

Re: StyleX – Meta's styling library

#28

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.

Fair point, I like the component library, and it's clunky but powerful.

createTheme() (from this library) seems clunky too, but makes sense.

Re: StyleX – Meta's styling library

#29
I really enjoy when libraries or languages have a “Thinking in X” post of some kind. I find it really helps orient me once I actually get to writing some code. If anybody has any “Thinking in X” examples that you have found particularly useful, let me know!

Re: StyleX – Meta's styling library

#30
post #22

Earlier quoted context omitted.

0 runtime is the argument over emotion (and therefore MUI right now)

thanks for pointing this out. I hope they extend their `thinking in stylex` page with this info.

They explain the 0-runtime pretty thoroughly.
Post reply on HN