Public
Script
Readme

Rendering html with jsx - https://github.com/ije/html

  • using JSX
  • support Atomic CSS powered by UnoCSS
  • dark mode(color scheme)
/** @jsx h */ import { h, html } from "https://esm.town/v/ije/html"; export default () => { return html( <div class="flex items-center justify-center w-screen h-screen"> <p class="text-5xl font-bold text-green-600">Hello World!</p> </div> ); };

Demo: https://www.val.town/v/ije/htmlDemo

1
2
3
4
5
6
7
8
9
10
11
import html, { Fragment, h } from "https://deno.land/x/htm@0.2.3/mod.ts";
import ColorScheme from "https://deno.land/x/htm@0.2.3/plugins/color-scheme.ts";
import UnoCSS from "https://deno.land/x/htm@0.2.3/plugins/unocss.ts";
// enable UnoCSS
html.use(UnoCSS());
// check the color scheme with system settings automatically
html.use(ColorScheme("auto"));
export { Fragment, h, html };
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
March 14, 2024