• Stars
    star
    115
  • Rank 305,916 (Top 7 %)
  • Language
    TypeScript
  • Created over 1 year ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easily migrate code from tailwind to Panda CSS

tw2panda

Easily migrate code from tailwind to Panda CSS

Screenshot 2023-08-08 at 01 34 49

Features

You can look at this file for an example of what it can do: example

VSCode extension

Select the text you want to convert and run the tw2panda: Rewrite tw to Panda CSS command. https://marketplace.visualstudio.com/items?itemName=astahmer.tw2panda-vscode

Install & usage

pnpm add tw2panda

It exports a bunch of functions that can be used to build your own tooling on top of it. You can look at the CLI code or the tests to see how it can be used.

CLI

npx tw2panda -h
tw2panda/0.1.0

Usage:
  $ tw2panda <command> [options]

Commands:
  rewrite <file>       Output the given file converted to panda, doesn't actually write to disk unless using -w
  extract <file>       Extract each tailwind candidate and show its converted output, doesn't actually write to disk
  convert <classList>  Example: inline-flex disabled:pointer-events-none underline-offset-4

For more info, run any command with the `--help` flag:
  $ tw2panda rewrite --help
  $ tw2panda extract --help
  $ tw2panda convert --help

Options:
  -h, --help     Display this message
  -v, --version  Display version number

rewrite

Usage:
  $ tw2panda rewrite <file>

Options:
  --tw, --tailwind <file>  Path to tailwind.config.js
  -w, --write              Write to disk instead of stdout
  -s, --shorthands         Use shorthands instead of longhand properties
  -c, --config <path>      Path to panda config file
  --cwd <cwd>              Current working directory (default: /Users/astahmer/dev/alex/tailwind-to-css-in-js/packages/tw2panda)
  -h, --help               Display this message

extract

Usage:
  $ tw2panda extract <file>

Options:
  --tw, --tailwind <file>  Path to tailwind.config.js
  -s, --shorthands         Use shorthands instead of longhand properties
  -h, --help               Display this message

convert

Usage:
  $ tw2panda convert <classList>

Options:
  -s, --shorthands  Use shorthands instead of longhand properties
  -h, --help        Display this message

Alternatives

https://github.com/jherr/tw2panda-cli / you can see the live demo here https://www.youtube.com/watch?v=fKSemrudovo&t=442s

Contributing

  • pnpm i
  • pnpm build
  • pnpm test

When you're done with your changes, please run pnpm changeset in the root of the repo and follow the instructions described here.

More Repositories

1

openapi-zod-client

Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml)
TypeScript
753
star
2

typed-openapi

Generate a headless Typescript API client from an OpenAPI spec
TypeScript
183
star
3

box-extractor

Static code extraction. Zero-runtime CSS-in-TS `<Box />` -> became a part of Panda CSS
TypeScript
128
star
4

pandabox

a toolbox for Panda CSS
TypeScript
47
star
5

panda-monorepo

example of a panda monorepo usage with a consuming app and multiple ui-lib providers
TypeScript
40
star
6

jotai-yjs

jotai-yjs makes yjs state even easier
TypeScript
36
star
7

panda-monorepo-setup

Panda monorepo setup examples
31
star
8

partyrpc

Partykit + RPC. Move Fast (and Break Everything). Everything is better with typesafety.
TypeScript
30
star
9

crepe-ui

πŸ₯ž a Chakra UI port using Panda + Ark-UI
TypeScript
17
star
10

transformer

Takes an input (ex: TS) and ouputs to destination format (ex: Zod/JSON/Open API Schemas)
TypeScript
13
star
11

pastable

πŸ“¦ A collection of pastable code gathered from past projects
TypeScript
12
star
12

vite-react-chakra-ts

Front SPA with: React 18+ / Typescript 4.7+ / Vite / Chakra-UI / React-Router / Jotai / XState / axios + react-query
TypeScript
9
star
13

typemorph

what if zod had a child with ts-morph
TypeScript
8
star
14

astahmer.dev

TypeScript
5
star
15

entity-routes

Design your REST API around your TypeORM entities in minutes. Instant CRUD with a single @EntityRoute decorator. Compatible with Koa/Express and any Connect based middleware.
TypeScript
5
star
16

vite-kikko-models

very early PoC of making offline-first easy using kikko/kysely/mikro-orm
TypeScript
4
star
17

lightningcss-ast-viewer

LightningCSS AST viewer.
TypeScript
4
star
18

entity-validator

Entity(Class) level validator based on class-validator interfaces
TypeScript
3
star
19

eslint-config

JavaScript
2
star
20

panda-tw

JavaScript
2
star
21

partykit-typeschema

TypeScript
2
star
22

vite-react-ts

TypeScript
2
star
23

panda-vite-template

TypeScript
2
star
24

vite-react-tamagui-ts

TypeScript
2
star
25

vite-react-ssr

TypeScript
1
star
26

vite-r3f

same as vite-react-chakra-ts but with react-three-fiber deps & AppCanvas/CameraControls
TypeScript
1
star
27

r3f-experiment

TypeScript
1
star
28

xstate-actors-example

TypeScript
1
star
29

rakkas-vanilla-extract-issue

TypeScript
1
star
30

sandbox-next-ts-chakra

TypeScript
1
star
31

superturk

TypeScript
1
star
32

tsc-runtime-type-benchmarks

benchmarking tsc speed across runtime type libraries
TypeScript
1
star
33

vite-r3flex-issue

repository made for an issue reproduction
TypeScript
1
star
34

box-extractor-ve-demo

Zero-runtime CSS-in-TS `<Box />` demo
TypeScript
1
star
35

astahmer.dev-astro

Astro
1
star
36

astahmer.dev-vite-plugin-ssr

TypeScript
1
star
37

vanilla-theme

TypeScript
1
star
38

vite-kikko-issue-repro

TypeScript
1
star
39

ts-lib-template

TypeScript
1
star
40

tailwind-to-css-in-js

TypeScript
1
star
41

box-extractor-vanilla-wind-demo

TypeScript
1
star
42

ve-dev-ssr-bug-repro

TypeScript
1
star