Skip to content
Discussion options

You must be logged in to vote

Meta used something very similar to CSS modules before StyleX and we were able to create a script/codemod that was able to automatically convert ~80% of cases.

I think something like that is likely the most effective path forward. I'll try to explain the details I think of, but feel free to ask any follow-up questions.

CSS Layers is a good starting point.

If you configure your tooling to wrap all your existing styles in a CSS layer, and allow stylex styles to "win", that is a good start to have determinism during the migration.

Migrate "large chunks" of files at a time

Generally speaking if an HTML element is all StyleX or all CSS modules, there should be no style conflict. And so you can…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@nmn
Comment options

nmn Nov 25, 2025
Collaborator

@mjames-c
Comment options

@mjames-c
Comment options

@mellyeliu
Comment options

@nmn
Comment options

nmn Dec 2, 2025
Collaborator

Answer selected by mjames-c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants