Skip to main content
Home

Built and signed on GitHub Actions

Middleware for pre-rendering Master CSS in Hono.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (0.2.0)

hono-mastercss

Overview

Middleware for pre-rendering Master CSS in Hono.

  • 0 client-side JavaScript required for initial rendering.
    • No need to wait for @master/css-runtime to be generated for the first time.
    • Of course, when used in conjunction with @master/css-runtime, it can also be used for Web Application using HTMX, etc!

Installation

npx jsr add @totto/hono-mastercss
yarn dlx jsr add @totto/hono-mastercss
pnpx jsr add @totto/hono-mastercss
bux jsr add @totto/hono-mastercss

Usage

demo

Without Config

import { Hono } from "@hono/hono";
import { mastercssMiddleware } from "@totto/hono-mastercss";

const app = new Hono();

app.use(masterCssMiddleware());

app.get("/", (c) => {
  return c.html(
    "<html><body><div class='m:50'>Hello World!!!</div></body></html>",
  );
});

// ...

With Config

import { Hono } from "@hono/hono";
import { masterCssMiddleware } from "@totto/hono-mastercss";

import config from "./mastercss.css.ts";

const app = new Hono();

app.use(masterCssMiddleware(config));

app.get("/", (c) => {
  return c.html(
    "<html><body><div class='m:50'>Hello World!!!</div></body></html>",
  );
});

// ...

For Developers

We use Deno.

The version is .mise.toml.

Check

deno task precommit
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@totto/hono-mastercss

Import symbol

import * as hono_mastercss from "@totto/hono-mastercss";
or

Import directly with a jsr specifier

import * as hono_mastercss from "jsr:@totto/hono-mastercss";

Add Package

pnpm i jsr:@totto/hono-mastercss
or (using pnpm 10.8 or older)
pnpm dlx jsr add @totto/hono-mastercss

Import symbol

import * as hono_mastercss from "@totto/hono-mastercss";

Add Package

yarn add jsr:@totto/hono-mastercss
or (using Yarn 4.8 or older)
yarn dlx jsr add @totto/hono-mastercss

Import symbol

import * as hono_mastercss from "@totto/hono-mastercss";

Add Package

vlt install jsr:@totto/hono-mastercss

Import symbol

import * as hono_mastercss from "@totto/hono-mastercss";

Add Package

npx jsr add @totto/hono-mastercss

Import symbol

import * as hono_mastercss from "@totto/hono-mastercss";

Add Package

bunx jsr add @totto/hono-mastercss

Import symbol

import * as hono_mastercss from "@totto/hono-mastercss";