Skip to main content
Deno 2 is finally here 🎉️
Learn more

Freshwind

A Fresh plugin for working with Twind v1

Based on the existing plugin with tweaks from psimk’s sanban

Usage

// twind.config.ts
import { defineConfig } from "@twind/core";
import presetTailwind from "@twind/preset-tailwind";

// Twind v1 configuration
// Learn more at https://twind.style/installation
export default defineConfig({
  presets: [presetTailwind()],
});

// Make sure you export your config's URL
// so that it can referenced in islands
export const configURL = import.meta.url;
// main.ts
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";

import freshwind from "freshwind/plugin.ts";
import config, { configURL } from "./twind.config.ts";

await start(manifest, {
  plugins: [freshwind(config, configURL)],
});
// routes/index.tsx
export default function Home() {
  return (
    <p class="text-slate-500 bg-slate-100 my-3">
        Welcome to `fresh`. Try update this message in the ./routes/index.tsx
        file, and refresh.
    </p>
  );
}