Skip to content

A simpler code translator to convert code using Tailwind to code using StyleX

License

Notifications You must be signed in to change notification settings

nmn/tw-to-stylex

Repository files navigation

tw-to-stylex

A simpler code translator to convert code using Tailwind to code using StyleX

TODO

  • className={cn("m-1 text-red-500", prop.className)}

    • should become {..._stylex.props(styles.$1, prop.className)}
    • but is currently: {..._stylex.props(styles.$1)}
  • There might multiple stylex imports, but it should be fine.

  • It'll insert a second stylex.create call even when one exists

  • [-] Support this pattern: <div className={cn(hidden lg:inline-flex text-[${tokens.textColor}])} />

  • Add and use a custom tw function to behave like stylex.atom().

  • A Babel plugin for style:x={} instead of a spread

About

A simpler code translator to convert code using Tailwind to code using StyleX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published