|
| 1 | +# headwind |
| 2 | + |
| 3 | +The core CSS engine powering the Crosswind framework. Headwind handles parsing, rule generation, scanning, and CSS output for utility-first CSS classes. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +```bash |
| 8 | +bun add headwind |
| 9 | +``` |
| 10 | + |
| 11 | +```bash |
| 12 | +npm install headwind |
| 13 | +``` |
| 14 | + |
| 15 | +## Usage |
| 16 | + |
| 17 | +```typescript |
| 18 | +import { build, buildAndWrite } from 'headwind' |
| 19 | +import { config } from 'headwind' |
| 20 | + |
| 21 | +// Build CSS from content patterns |
| 22 | +const result = await buildAndWrite({ |
| 23 | + ...config, |
| 24 | + content: ['./src/**/*.html'], |
| 25 | + output: './dist/styles.css', |
| 26 | + minify: true, |
| 27 | +}) |
| 28 | + |
| 29 | +console.log(`Generated ${result.classes.size} classes in ${result.duration}ms`) |
| 30 | +``` |
| 31 | + |
| 32 | +### Using as a Bun Plugin |
| 33 | + |
| 34 | +```typescript |
| 35 | +import { plugin } from 'headwind' |
| 36 | + |
| 37 | +await Bun.build({ |
| 38 | + entrypoints: ['./src/index.ts'], |
| 39 | + outdir: './dist', |
| 40 | + plugins: [plugin()], |
| 41 | +}) |
| 42 | +``` |
| 43 | + |
| 44 | +## Features |
| 45 | + |
| 46 | +- Utility class parsing and CSS generation |
| 47 | +- Configurable theme (colors, spacing, fonts, breakpoints, etc.) |
| 48 | +- Variant support (responsive, hover, focus, dark mode, and many more) |
| 49 | +- Preflight / CSS reset styles |
| 50 | +- Custom rules and shortcuts |
| 51 | +- Preset system |
| 52 | +- Compile class transformer |
| 53 | +- Attributify mode |
| 54 | +- Bracket syntax support |
| 55 | +- File scanning and transformation |
| 56 | +- Bun plugin integration |
| 57 | + |
| 58 | +## License |
| 59 | + |
| 60 | +MIT |
0 commit comments