A stylesheet for pages that describe themselves

ASW styles documents written in plain semantic HTML. There are no utility classes and no component classes to memorise: the element says what it is, and the stylesheet answers.

<link rel="stylesheet" href="dist/asw.css">

This page, and every other page of this site, is built with ASW and carries not a single class attribute. View source: the markup is the documentation.


The one rule

Everything here follows from three lines of markup discipline. If you break them, the stylesheet stops being able to help you — and the page starts needing a designer again.

Semantic HTML only

Structure carries meaning: header, main, article, nav, aside, figure, table. Presentation is never asked to invent structure that the document already has.

Data attributes for variants

Where a document needs a shape, it declares a state or a layout: data-layout="docs", data-callout="warning", data-pane="code". Attributes belong to the document; they do not name visual accidents.

Zero classes

A generated page cannot invent a component name that the stylesheet has never heard of. With no classes, there is nothing to invent: a page written by an agent today renders with the same contract as one written by hand.


Specimen

The rest of this page is the specimen: the type scale, the inline semantics, the lists, the table, the code. It is not a gallery of parts — it is the page you are reading, working at its normal size.

The page title above is the h1; the scale continues downward from here.

Heading two

Heading three

Heading four

Heading five
Heading six

A paragraph of continuous prose, at the measure this stylesheet chooses for reading. Inline semantics keep their meaning without decoration: strong for weight, emphasis for stress, code for identifiers, kbd for keys, mark for a passage that was found, ASW for an abbreviation, for a date, samp for program output, var for a variable, del for what was removed and ins for what replaced it.

A stylesheet is a contract about meaning. Once the contract is written down, the page can be generated by anything that can write HTML — including an agent that has never seen the stylesheet.

— the premise of ASW

Lists carry structure

Definition list
For terms and their meanings, which is most of what documentation is.
Zero classes
The constraint that makes generated pages reliable.

Tables are arguments

What each landmark is for, in the order a document uses them
Element Role Count
header Opening matter: title, standfirst, actions. Once
nav Ways through the document or the site. As needed
main The document itself, without the furniture. Once
aside Matter that qualifies the main line without interrupting it. As needed
footer Provenance, dates, how to verify. Once

Code is a first-class motif

git clone https://github.com/trentuna/asw
cd asw
npm ci
npm run build
open templates/index.html

Where to go next

Guide

Install it, build it, and read the anatomy of a page: which landmarks go where and why the order matters.

Reference

Element by element: what each semantic tag receives for free, and which data attribute changes which aspect.

Examples

Living examples with the source and the result side by side — callouts, tables, forms, diffs, charts, splits.