MCPcopy Index your code
hub / github.com/Mokshit06/typewind

github.com/Mokshit06/typewind @0.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.3.0 ↗ · + Follow
65 symbols 157 edges 55 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

The safety of Typescript with the magic of Tailwind.


Introduction

Typewind brings the safety, productivity and intellisense of Typescript over to Tailwind

import { tw } from 'typewind';

const styles = tw.border.hover(tw.border_black);

How it works

Typewind's compiler is a babel plugin that runs over your code, statically analyses it and converts all the tw styles into their corresponding Tailwind classes.

This results Typewind compiles away, leaving 0 runtime code.

import { tw } from 'typewind';

const styles = tw.border.hover(tw.border_black);

// ↓ ↓ ↓ ↓ ↓ ↓

const styles = 'border hover:border-black';

Features

Zero bundle size - Typewind compiles away all the styles used, and converts them to static classes at build

Apply variants to multiple styles at once - Since Typewind uses TS, it allows for more intuitive syntax for applying variants

import { tw } from 'typewind';

const mediaStyles = tw.sm(tw.w_4.mt_3).lg(tw.w_8.mt_6);
const groupInGroups = tw.text_sm.sm(tw.bg_black.hover(tw.bg_white.w_10));

Type safety and intellisense - Using the TS compiler, Typewind is able to provide type safety to tailwind, and provide intellisense & autocomplete for all the classes from tailwind config.

import { tw } from 'typewind';

const styles = tw.border_blackk; // ❌ Property 'border_blackk' does not exist on type 'Typewind'. Did you mean 'border_black'?

The above code would also return in a build error on running tsc

Types generated from config - Type definitions of tw are generated directly from your tailwind config, so it is always custom to you, and also creates types for custom theme palette and plugins.

Powered by Vercel

Core symbols most depended-on inside this repo

transformBabel
called by 5
packages/typewind/src/transform.ts
cn
called by 4
packages/typewind/src/cn.ts
spreadModifier
called by 4
packages/typewind/src/runtime.ts
fmtToTypewind
called by 4
packages/typewind/src/cli.ts
spreadModifier
called by 3
packages/typewind/src/evaluate.ts
loadConfig
called by 2
packages/typewind/src/utils.ts
createTypewindContext
called by 2
packages/typewind/src/utils.ts
objectTemplate
called by 2
packages/typewind/src/cli.ts

Shape

Function 59
Method 4
Class 2

Languages

TypeScript83%
Rust17%

Modules by API surface

packages/typewind/swc/lib.rs11 symbols
packages/typewind/src/cli.ts10 symbols
packages/typewind/src/runtime.ts8 symbols
packages/typewind/src/evaluate.ts7 symbols
packages/typewind/src/utils.ts3 symbols
packages/typewind/src/babel.ts3 symbols
site/components/Features.tsx2 symbols
tests/transform.test.ts1 symbols
tests/fixtures/transform/App.tsx1 symbols
tests/fixtures/normal-usage/App.tsx1 symbols
tests/fixtures/modifiers/App.tsx1 symbols
tests/fixtures/container-queries/App.tsx1 symbols

For agents

$ claude mcp add typewind \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact