GitXplorerGitXplorer
n

tw-to-stylex

public
88 stars
3 forks
0 issues

Commits

List of commits on branch main.
Unverified
8175ce964df81989d14a19c2da8fb31c58126df8

tw returns StyleX style object now

nnmn committed 2 months ago
Unverified
7f36d9484daee6f62445be9fbb4ad5a9e1e6712f

Nearly complete tw() types

nnmn committed 2 months ago
Unverified
566b089822fdddded85d184a11ee3b78739d8617

update everything

nnmn committed 2 months ago
Unverified
a2a1b9ffb62e6fed277559a495420b32710fc814

Add a test to start fixing edge-cases

nnmn committed 2 months ago
Unverified
92c227223688eb30358834d6ee11625ff00bcea3

pack into shorthands when possible

nnmn committed 2 months ago
Unverified
775646954ba228eb174051cd3f7aff6eb55d28d7

Actually start using Tailwind 4 engine

nnmn committed 2 months ago

README

The README file for this repository.

tw-to-stylex

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

TODO

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

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

  • [x] 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