typed-css

command
v4.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 5 Imported by: 0

README

Typed CSS

A click counter styled entirely with the typed CSS layer (css + css/u) — type-checked, content-hashed, zero-runtime-string-soup styling authored right next to the markup.

The view is written bare: it dot-imports css/u for utilities and html/shorthand for elements, so there are no css./u. qualifiers anywhere. Each style folds to a deterministic, content-hashed class; identical rules dedupe to one class and the stylesheet is injected once.

What it shows

  • Composing styles with the Tailwind-shaped utility layer (Flex, Pad, Rounded, Hover(...), Transition(...)) on top of the raw typed-CSS primitives.
  • css.Class(...) as the clsx-style entry point — mixing literal strings, typed rules, variant slices, and pre-folded sheets in one call.
  • Type-safe values (Hex, RGBA, Spacing, Rem) instead of free-form strings, so a typo is a compile error rather than a silently-broken rule.
  • css.SeedFromDocument() on boot so server-rendered rules are adopted (not re-injected) on hydration.

Run

gwc dev examples/public/typed-css

The emitted CSS is hardened against </style> breakout and the class names are stable across builds, so the same source always produces the same stylesheet.

Documentation

Rendered for js/wasm

Overview

Command typed-css is the runnable demo for the F3 typed-CSS package. The view (counter.go) is authored fully bare — dot-importing css/u for styling and html/shorthand for elements, with no css./u. qualifiers anywhere.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL