Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/codehz/css-in-bun

CSS-in-Bun macro inspired by Meta's stylex (and johanholmerin/style9)
https://github.com/codehz/css-in-bun

bun bun-macro css-in-js typescript

Last synced: 3 months ago
JSON representation

CSS-in-Bun macro inspired by Meta's stylex (and johanholmerin/style9)

Awesome Lists containing this project

README

        

# CSS-in-Bun macro inspired by Meta's stylex (and johanholmerin/style9)

Usage:
```tsx
// build.ts
import { Collector } from "css-in-bun/build";

using collector = Collector();

const res = await Bun.build({
entrypoints: ["./src/index.ts"],
outdir: "dist",
});

await Bun.write("./dist/style.css", collector.collect());

// component.tsx
import { create } from "css-in-bun" assert { type: "macro" };
const styles = create({
test: {
color: "red",
backgroundColor: "green",
"@media (min-width: 80em)": {
color: "purple",
":hover": {
color: "black",
},
},
":hover": {
color: "yellow",
},
},
});

const Test = () =>


```

Due to bun's bug(https://github.com/oven-sh/bun/issues/6014), use keyframes may cause bun crash.