Engine and CLI
Coming from Tailwind
Convert existing Tailwind classes to JX, in the browser or across a whole project.
Try it
Paste Tailwind classes: the converter runs in this page, with the same engine as the CLI.
flex ai:center jc:between gap:4 px:6 py:3 br:xl bg:white sh:md md:px:8 hover:bg:blue-100 space-y-2
- hover:bg-sky-50 becomes hover:bg:blue-100: sky-50 approximated as blue-100
- space-y-2 is kept: use gap: on a flex or grid parent
jx migrate
jx migrate rewrites
classes: '…' in Dart files and
class="…" in HTML. It lists the changes first; nothing is written without
--write.
dart run jx_cli:jx migrate -i "px-4 hover:bg-sky-500" # one string
dart run jx_cli:jx migrate # lists the changes
dart run jx_cli:jx migrate --write # applies them
dart run jx_cli:jx migrate lib/pages # a folder or a file
Interpolated strings ('p-$size') are left alone, and free text such as
.text('items-center')
is never touched.
How classes map
| Tailwind | JX | Rule |
|---|---|---|
items-center |
ai:center |
Abbreviated property, value after a colon |
px-4 w-1/2 |
px:4 w:1/2 |
Same spacing scale and fractions |
md:hover:bg-blue-500
|
md:hover:bg:blue-500
|
Variants are unchanged |
-mt-2 !p-4 |
-mt:2 p:4! |
Negative prefix kept, important at the end |
w-[42px] |
w:[42px] |
Arbitrary values kept |
bg-sky-500 |
bg:blue-500 |
Closest family and shade, reported |
Every result is compiled before being offered, so a converted class always produces CSS.
What is not converted
-
space-x-*,space-y-*anddivide-*: usegap:on a flex or grid container. -
containerandprose: write the widths and typography you need. -
Per-corner radius (
rounded-tl-lg); color opacity modifiers (bg-black/50) lose their opacity, which is reported.
Note
Classes kept unchanged are listed with the reason, so nothing disappears silently.