css-in-bun
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

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

Usage:

// 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 = () => <div className={styles.test}></div>

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.119latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.119
0.2.00
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i css-in-bun

Weekly Downloads

19

Version

0.2.1

License

MIT

Unpacked Size

46.6 kB

Total Files

9

Last publish

Collaborators

  • codehz