Stylex Profile Banner
Stylex Profile
Stylex

@stylexjs

Followers
1,515
Following
36
Media
16
Statuses
213

Paid shill for the build-time static CSS generator that powers Meta.

Joined December 2021
Don't wanna be here? Send us removal request.
Explore trending content on Musk Viewer
Pinned Tweet
@stylexjs
Stylex
6 days
A community member has been maintaining an SWC plugin for StyleX that includes a line by line translation of most of StyleX to Rust.
1
3
30
@stylexjs
Stylex
10 months
😍🤩🥳 Thank You!
Tweet media one
Tweet media two
2
7
135
@stylexjs
Stylex
10 months
We’ve been open source for a week. AMA
@t3dotgg
Theo - t3.gg
10 months
STYLEX is OPEN SOURCE (and my video is only a week-ish late)
Tweet media one
4
6
81
4
6
94
@stylexjs
Stylex
6 months
🎉 It’s release day! v0.6.1 is out. This is release is all about types…for CSS variables.
3
11
82
@stylexjs
Stylex
8 months
The only concepts you need to understand in StyleX: 1. Style Objects - apply them, merge them, use them conditionally whatever 2. Variable Objects - use them within styles 3. Themes - set values for variables on a UI sub-tree That’s it. Seriously.
2
5
49
@stylexjs
Stylex
4 months
Built a Next + CLI example and even with some issues, it’s so much better already! ✅ Next 15 RC ✅ TurboPack dev+prod ✅ Next/Font 🚧 the @/ alias is broken 🚧 using styleX in dependencies has some issues 🚧 not all config options available yet
0
2
37
@stylexjs
Stylex
10 months
A release before we wrap up the year with lots of small fixes and improvements. Biggest things in the new year.
0
4
33
@stylexjs
Stylex
11 months
We’re looking at Tailwind’s approach with “group”.
@adamwathan
Adam Wathan
11 months
Curious what the recommended way to handle a hover state like this would be with StyleX, since they explicitly forbid styling based on parent hover. Use JS to detect pointerEnter/pointerLeave on the parent and set some state that you use to change the text color?
Tweet media one
11
6
127
4
3
33
@stylexjs
Stylex
4 months
V0.7.0 with CLI is finally out! You can finally use StyleX within. Next app without opting out of SWC and TurboPack! Also improvements to variables and fixes to bundler plugins.
3
6
30
@stylexjs
Stylex
8 months
Just CSS* *without selectors.
3
2
28
@stylexjs
Stylex
11 months
Here’s another guide to get started with a bare-bones Next+StyleX+open-props project from @argyleink The StyleX repo has an example app to copy as well.
0
2
26
@stylexjs
Stylex
4 months
We are aware of integration problems with certain frameworks, specially when using RSCs. We are working on making the experience better and would love some help!
5
2
27
@stylexjs
Stylex
10 months
Amazing, in-depth video explaining StyleX from @DevSimplified This is now the new canonical starting point for anyone diving into StyleX for the first time.
0
3
25
@stylexjs
Stylex
11 months
@OrangeCMS @reactnative The API is similar, but extended to support media queries, pseudo classes etc.
1
0
10
@stylexjs
Stylex
11 months
Shout out to the good folks at @RockstarGames for releasing the GTA 6 trailer a day early to make way for the launch. And imitation really is the best form of flattery. They, too, are pre-announcing 2 years early!
1
2
21
@stylexjs
Stylex
7 months
@JoshWComeau @steida Descendent and sibling selector support is in the works. We hope most migrations from existing CSS-in-JS can be codemods.
1
0
20
@stylexjs
Stylex
10 months
Thanks for us trying out @leeerob . We are learning from your pain points and addressing them.
@leeerob
Lee Robinson
10 months
CSS in 2024 is amazing.
32
92
809
0
0
19
@stylexjs
Stylex
6 months
Choose rad!
Tweet media one
@argyleink
Adam Argyle
6 months
0
0
1
0
0
19
@stylexjs
Stylex
4 months
@t3dotgg @thdxr @nbcng10 The very definition.
1
0
17
@stylexjs
Stylex
9 months
Hot off the presses. Version 0.5.0!
@naman34
Naman
9 months
Not too long ago, we released @stylexjs v0.5.0! This is a pretty big release so let me mention some of the highlights. 🧵
4
4
36
0
1
17
@stylexjs
Stylex
4 months
@thdxr @nbcng10 It’s been going great for over five years at Meta.
2
0
16
@stylexjs
Stylex
10 months
🫶
@leeerob
Lee Robinson
10 months
And finally, some thoughts from StyleX, a new zero-runtime CSS-in-JS solution. Really nice docs page on their core principles.
Tweet media one
0
5
40
0
3
15
@stylexjs
Stylex
6 months
CSS variables can now have types that are enforced by the browser. StyleX now exports functions such as stylex.types.color() that can be used when defining variables.
Tweet media one
Tweet media two
2
1
13
@stylexjs
Stylex
5 months
Server rendering overhead of StyleX?
@sebastienlorber
Seb ⚛️ ThisWeekInReact.com
5 months
📜 Quantifying the Impact of Styled Components on Server Response Times - @drewml Uses SpeedScope to analyze a CPU trace Styled Components account for 47% of SSR time 😝 A good reason to move to a zero-runtime CSS-in-JS solution with build-time extraction, or Tailwind
Tweet media one
0
4
24
1
1
12
@stylexjs
Stylex
10 months
👀
@leeerob
Lee Robinson
10 months
@cpojer You're right 😂 Will add. Making a StyleX version too 👀
Tweet media one
4
0
8
0
0
11
@stylexjs
Stylex
6 months
Our release notes include a small homage to the rotating gradient background and glow:
1
1
10
@stylexjs
Stylex
10 months
And someone already made an Astro+StyleX integration.
0
1
10
@stylexjs
Stylex
11 months
This is the Pandora’s box. Don’t do it!
@adamwathan
Adam Wathan
11 months
How many years have you been asking me for this one? 🫣
15
16
298
0
0
10
@stylexjs
Stylex
7 months
CSS Cascade: The strategy used for choosing which CSS rule should win multiple rules apply. Aka Specificity Wars. Inheritance: Child elements getting some styles from their parents. E.g. font-size, color, etc. Composition: Merging styles to customise base component styles.
0
0
9
@stylexjs
Stylex
7 months
CSS is powerful and has amazing features. CSS layers is one of those amazing features. Our job is to generate CSS that makes good use of that power while giving developers an interface that is vastly simpler, easier and more predictable.
@username_ZAYDEK
Z 🏴‍☠️
7 months
@stylexjs is so clever. It uses Cascade Layers to make CSS predictable, so last **always** wins. Bascially all CSS libraries struggle with this unless you manage cascade layers yourself, but StyleX generates cascade layers for you as a side effect
Tweet media one
2
0
7
0
1
9
@stylexjs
Stylex
11 months
@adamwathan Will be adding proper support for this pattern soon. For now the recommendation is to use variables.
2
0
8
@stylexjs
Stylex
10 months
🥂🍻💜 ✌️UnoCSS ( @antfu7 ) 🦜 @tamagui_js 🐼 @panda__css 🍃NativeWind (and @tailwindcss ) 🧁Vanilla Extract ( @markdalgleish )
0
0
8
@stylexjs
Stylex
6 months
… and there’s a bunch of bug-fixes. Read about all the new features and bug fixes.
0
0
7
@stylexjs
Stylex
9 months
StyleX is designed to be cached. Anything that might break that will live separately.
@naman34
Naman
9 months
@trysmudford @steida @stylexjs Not with Stylex itself. It would be trivial when using Bun macros. I’m planning on porting Bun macros to Babel soon.
2
0
5
0
0
6
@stylexjs
Stylex
10 months
@Haddadome That’s a separate project already being worked on. Will be released eventually, but not soon.
0
0
6
@stylexjs
Stylex
11 months
@ArthurODS_ @OrangeCMS @reactnative We’re still working on a React Native version. We don’t know what features will be supported.
1
1
6
@stylexjs
Stylex
6 months
Huge thanks to NedJulius and QingqiShi for contributing the ESLint rule to “sort-keys” to help enforce consistent ordering of styles. And a prettier plugin too!
1
0
5
@stylexjs
Stylex
6 months
@JoshWComeau @NoriSte You should probably look at Linaria based on your needs. It’s traditional styled components that are compiled static CSS. It supports all crazy selectors that we never will.
0
0
5
@stylexjs
Stylex
6 months
But that’s not all! You can now use stylex.firstThatWorks for defining fallback values for variables that are not defined. No new API!
Tweet media one
1
0
5
@stylexjs
Stylex
6 months
This may not be a good idea. Help us decide.
@stylexjs
Stylex
6 months
We have an RFC for an API to define styles completely inline. Would love your feedback!
2
3
24
0
0
4
@stylexjs
Stylex
7 months
If you were confused by all these terms, here’s simplified descriptions.
@stylexjs
Stylex
7 months
CSS Cascade: The strategy used for choosing which CSS rule should win multiple rules apply. Aka Specificity Wars. Inheritance: Child elements getting some styles from their parents. E.g. font-size, color, etc. Composition: Merging styles to customise base component styles.
0
0
9
0
1
4
@stylexjs
Stylex
10 months
@artfromclt @stitchesjs Please tell us about the APIs from Stitches that you feel are missing and we can look into it.
0
0
4
@stylexjs
Stylex
11 months
@realitydesignrs There is a NextJS example in the repo.
0
0
4
@stylexjs
Stylex
4 months
@HipsterSmoothie has a knack for finding issues. We are so thankful!
@HipsterSmoothie
Andrew Lisowski
4 months
Messing around on side projects helps the community ❤️ Building out fwoosh (RSC storybook) and i've logged issues in: - - @stylexjs - @reactjs 🚀
0
2
5
0
1
3
@stylexjs
Stylex
2 years
The logo that wasn't. If we were still in the 90s, the StyleX logo may have looked like this:
Tweet media one
0
0
3
@stylexjs
Stylex
5 months
@deadalnix We don’t use Webpack internally, and we are aware of the problems with it. We are shipping a separate CLI to help while we get that sorted.
1
0
2
@stylexjs
Stylex
2 years
The logo that wasn't, part 2. This one is called "negative glow". I still think it looks quite cool, but it doesn't look so great in light-mode, `x` isn't easy to read for a lot of people and it requires "js" in the name.
Tweet media one
0
0
3
@stylexjs
Stylex
6 months
@deadalnix @naman34 There is a CLI in the works. Not quite ready yet.
0
0
2
@stylexjs
Stylex
10 months
@olivtassinari @DanyCamirand @MUI_hq You can leave the debug classNames on in production if you so wish. … even though the option is called “dev”.
1
0
2
@stylexjs
Stylex
7 months
@BeeEmSea @naman34 @thisizkp @username_ZAYDEK @nextjs Technically it can support any setup. But the CLI will make the most sense for scenarios where you aren’t using Babel.
0
0
2
@stylexjs
Stylex
4 months
@tyler_dot_earth Help us write better bundler plugins and a better Next.js plugin.
@stylexjs
Stylex
4 months
@nicopellerin_io Help us write a better Next.js plugin if you know enough about how it works.
0
0
0
0
0
2
@stylexjs
Stylex
10 months
@kenrickbeckett @Meta But now you won’t be able to set a different value for them with stylex.createTheme! (We already infer styles as const in stylex.create())
0
0
2
@stylexjs
Stylex
7 months
@username_ZAYDEK @bentonnnnnn To be fair, tailwind-merge works OK. It’s larger and slower than StyleX. But it mostly works.
1
0
2
@stylexjs
Stylex
4 months
…And honoured to have React-Strict-DOM, which is built on StyleX to win an OSS award!
@ReactSummit
React Summit 💥 Amsterdam/New York & Online
4 months
Congrats🏆to the React OSS Awards winners! 💥Breakthrough of the Year: react-strict-dom ( @reactjs ) 💥The Most Exciting Use of Tech: React Native visionOS ( @callstackio ) 💥Productivity Booster: @gluestack 💥Fun Side Project of the Year: React Server Components in Go ( @JLarky )
0
7
11
0
0
2
@stylexjs
Stylex
10 months
@olivtassinari @DanyCamirand @MUI_hq One of our goals is to solve debugging with atomic styles. We’ve made some progress but more to come.
1
0
2
@stylexjs
Stylex
7 months
@JoshWComeau @username_ZAYDEK @steida This is the pattern we are planning to support. I.e “read” other elements but only style yourself. No styling at a distance. Glad to see it’s a pattern being used with vanilla CSS already.
0
0
2
@stylexjs
Stylex
7 months
@thisizkp @username_ZAYDEK @bentonnnnnn Layering is already not a problem with Tailwind. V4 is cleanup and perf upgrade. It doesn’t fundamentally change how it works.
2
0
1
@stylexjs
Stylex
10 months
@olivtassinari @DanyCamirand @MUI_hq StyleX can generate debug classNames to show you exactly where the styles are coming from.
1
0
1
@stylexjs
Stylex
11 months
@nicknisi @tailwindcss That statement was for when not using utility functions like clsx. Apart from the performance issues, clsx does solve most of the architectural limitations.
0
0
1
@stylexjs
Stylex
11 months
@username_ZAYDEK @thepredaytor @austin_malerba A PR has improved the auto-complete. Will be out in the next release. The styling limitations that exist today, will be removed soon.
1
0
1
@stylexjs
Stylex
11 months
@jacobrask We rarely need those patterns internally. When we do, we use workarounds. Solving this problem is important for us.
0
0
1
@stylexjs
Stylex
11 months
@thepredaytor @joebell_ CVA is incompatible with StyleX. Please don’t try to use them together. CVA works with strings and breaks StyleX guarantees.
0
0
1
@stylexjs
Stylex
8 months
@jadvani_yug Working on something that should support almost every setup. Will take a couple more weeks.
0
0
1
@stylexjs
Stylex
8 months
@steida The types are not the problem.
1
0
1
@stylexjs
Stylex
10 months
@thekxss @t3dotgg The problems it solves are usually more common with larger apps and teams, but StyleX works well for projects and teams of all sizes. Use it if it feels good to your team.
0
0
1
@stylexjs
Stylex
11 months
@joshmedeski @nicknisi @tailwindcss Clarification: In the docs, we’re talking architectural limitations on code organisation vs styling constraints which is what Adam is talking about and we agree with. Also: our intent is not to criticize Tailwind, but highlight differences.
1
0
1
@stylexjs
Stylex
11 months
@thepredaytor Ok! I misunderstood the intent of the original code. Some modifications: Skip the lines with stylex.include And be explicit about the variant being used. This can be wrapped in a component to provide defaults instead.
1
0
1
@stylexjs
Stylex
10 months
@username_ZAYDEK @bigmistqke And intellisense improvements are coming in the next release!
1
0
1
@stylexjs
Stylex
10 months
@TheNoahHein @dabit3 @CSSHooks @tailwindcss We only remove the “selectors” part of CSS. The styling part is identical to vanilla CSS. By design. So please learn CSS first and you can reach for StyleX if you feel like you need it.
0
0
1
@stylexjs
Stylex
6 months
@HouseOfMeza We don’t change the colors you author. If you author with oklch you should get oklch
1
0
1
@stylexjs
Stylex
10 months
@CanRau @lexicaljs Ancestor and sibling aware styles are on the roadmap.
1
0
1
@stylexjs
Stylex
6 months
@HouseOfMeza Please create GitHub issue.
1
0
1
@stylexjs
Stylex
4 months
@nicopellerin_io Help us write a better Next.js plugin if you know enough about how it works.
0
0
0
@stylexjs
Stylex
4 months
@BeeEmSea Yes. Still working on some documentation improvements. Didn’t want to hold the release any longer.
0
0
1
@stylexjs
Stylex
6 months
@thepredaytor @sawaratsuki1004 That’s on us. Will make a brand page for the website.
0
0
1
@stylexjs
Stylex
7 months
@JoshWComeau @username_ZAYDEK @steida Ok. Stay tuned! I think you’ll like what we come up with here.
0
0
1
@stylexjs
Stylex
11 months
@outoilkka It’s tailwind’s terminology.
0
0
1
@stylexjs
Stylex
11 months
@JollyShopland Our recommendation is to use just 3 lines as a reset. This is to maximise compatibility for components published to NPM. For apps, bring your own reset.
0
0
1
@stylexjs
Stylex
6 months
@steida That can be implemented as a sync tax transform on top of the StyleX compiler. StyleX avoids introducing custom API such as special props to JSX for a variety of reasons.
1
0
1
@stylexjs
Stylex
11 months
@thepredaytor @adamwathan Please put the media queries and pseudo classes within the value of properties. Only pseudo elements are supported on the top-level (things that start with “::”)
0
0
1
@stylexjs
Stylex
11 months
@thepredaytor Choose simplicity and don’t try to use fancy utility functions like CVA with StyleX. Here’s your code translated to StyleX APIs. This is safer and faster. And we’re more likely to be able to detect if these styles were unused.
Tweet media one
2
0
1