From 19771c93be42e617def0a161eab0b3bcd2e62a6b Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Mon, 29 Dec 2025 12:21:44 -0800 Subject: [PATCH] tweak css --- examples/spa/index.html | 5 +---- examples/spa/index.tsx | 2 +- examples/ssr/helpers.tsx | 2 +- server.tsx | 8 ++++++-- src/index.tsx | 8 +++++--- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/examples/spa/index.html b/examples/spa/index.html index 4d19034..3d4dcd9 100644 --- a/examples/spa/index.html +++ b/examples/spa/index.html @@ -3,15 +3,12 @@ + Forge SPA Examples diff --git a/examples/spa/index.tsx b/examples/spa/index.tsx index 283c6dd..ffa4855 100644 --- a/examples/spa/index.tsx +++ b/examples/spa/index.tsx @@ -1,5 +1,5 @@ import { render } from 'hono/jsx/dom' -import { App, route } from './app' +import { App } from './app' const root = document.getElementById('root') diff --git a/examples/ssr/helpers.tsx b/examples/ssr/helpers.tsx index b7d8cf6..e69088c 100644 --- a/examples/ssr/helpers.tsx +++ b/examples/ssr/helpers.tsx @@ -87,7 +87,7 @@ export const Layout = define({ {props.title} - + diff --git a/server.tsx b/server.tsx index d6b29fc..90f9d17 100644 --- a/server.tsx +++ b/server.tsx @@ -1,12 +1,16 @@ import { Hono } from 'hono' import { IndexPage, ProfileExamplesPage, ButtonExamplesPage, NavigationExamplesPage, FormExamplesPage } from './examples/ssr/pages' import { LandingPage } from './examples/ssr/landing' -import { styles, stylesToCSS } from './src' +import { stylesToCSS } from './src' const app = new Hono() app.get('/', c => c.html()) +app.get('/main.css', c => c.text(stylesToCSS(), 200, { + 'Content-Type': 'text/css; charset=utf-8', +})) + app.get('/ssr', c => c.html()) app.get('/ssr/profile', c => c.html()) @@ -17,7 +21,7 @@ app.get('/ssr/navigation', c => c.html()) -app.get('/styles', c => c.text(stylesToCSS(styles))) +app.get('/styles', c => c.text(stylesToCSS())) app.get('/spa/*', async c => c.html(await Bun.file('./examples/spa/index.html').text())) diff --git a/src/index.tsx b/src/index.tsx index db0ca30..e7f7e45 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3,8 +3,9 @@ import { type TagDef, UnitlessProps, NonStyleKeys } from './types' export const styles: Record> = {} +// All CSS styles inside