One visual language for every drawing in this repository: the
static SVG diagrams in diagrams/ and the interactive demos in
teaching-demos/. Every swatch and example on this page is drawn by
the real stylesheets.
teaching-demos/<topic>/). Otherwise it is a
diagram (an SVG file in diagrams/). Both use the same
classes.fill, stroke
or style attributes in a diagram, ever. A demo may set CSS
variables inline or from script, never literal colours.class="ag-box ag-blue". Leave the hue off and it draws in ink.
A hue on a <g> colours everything inside it.ag-faint or ag-ghost, supporting structure in
ag-muted, only the subject at full strength. If everything is
ink, there is no subject.ag-highlight. The twelve specific hues are for depicting real
things, not for telling parts of a schematic apart.ag-heat.viewBox="0 0 1200 675"
unless the content is genuinely a different shape; the width follows the
display width. Demos: about 700 wide, inside an element with
class="ag-demo".ag-connector path plus a
separate ag-arrowhead polygon. Never an SVG
<marker>.<title> is its alt text. Alt text and captions end with a
full stop. Demo controls are <label for> /
id pairs; output a screen reader needs is exposed with ARIA.agDrawing.css if both media could use it,
otherwise the layer. Record the decision in CLAUDE.md.| File | Holds | Who links it |
|---|---|---|
framework/agDrawing.css |
The shared language: neutrals, hues, roles, text, arrows, materials, heat, temperature, particles, graphs, modifiers. | Nobody directly. Both layers import it. |
framework/agDiagrams.css |
The diagram layer: canvas rules (documented), the ground, and
document defaults for svg and text. |
Every diagrams/*.svg, from its second line. |
framework/agTeachingDemos.css |
The demo layer: .ag-demo (type sizes for the demo
canvas), slider and meter controls, marching motion. |
Every teaching-demos/**/*.html. |
The test for which file something belongs in: if it changed in one
medium, should it change in the other too? Heat colour, ink, line weights
and arrowheads: yes, so they live in agDrawing.css. Slider styling
and the diagram ground: no, so each lives in its layer.
<object> and demos as
<iframe>, which load the live files. Edit a value in
agDrawing.css and every diagram, every demo and every deck that
shows them changes the next time it is opened. A deck only needs rebuilding
when its own markdown changes.The slide system (agSlides.css, build.html,
template.md) is separate and documented in
template.md. It styles the deck around a drawing, never
the drawing itself.
SVG elements carry no paint. Each gets classes describing what it is, and the stylesheet supplies the appearance. That is what makes it possible to restyle hundreds of drawings at once, years after they were made.
<rect class="ag-box ag-blue" .../> <!-- a role and a hue -->
<path class="ag-line ag-fine ag-faint" .../> <!-- a role, a weight, a neutral -->
<rect class="ag-metal ag-outline" .../> <!-- a material, outlined -->
style="fill:#000000" or fill="#000" ignores
the house style for ever, including the day everything else is restyled.
Inkscape adds these to every object without being asked: use the
? (unset) button in Fill & Stroke and save as
Plain SVG.Every raw colour is named once as a --ag-c-* variable. Roles
point at those rather than repeating a hex value. For example,
--ag-c-axis is var(--ag-c-muted), so a near-duplicate
grey can never creep back in. A hue class sets three carrier variables
(--ag-h-tint, --ag-h-base,
--ag-h-shade), and the role class decides which to paint with.
A demo may set variables inline or from script to tie appearance to
physics: --ag-march-speed, --ag-c-particle,
--ag-particle-r, --ag-c-metal (a named tint) and
--ag-h-base (a computed colour on one shape). It sets a
variable, so the stylesheet keeps the final say. Diagrams never do
this.
Classes are stacked, and when two single-class rules set the same property,
the one later in the file wins. agDrawing.css is therefore ordered
on purpose: tokens, then neutrals and hues (which set only variables, so they
are order-proof), then physics, roles, graphs and text, and finally the
modifiers (ag-fine, ag-heavy,
ag-dashed, ag-translucent), which must stay
last. In text, the colour modifiers must come after the size classes.
Two real bugs came from getting this wrong. The safest new modifier sets a
variable that a role reads.
The short practical checklist lives in diagrams/readme.txt.
This section is the full version.
Copy diagrams/_template.svg (the underscore keeps it out of the
index checks) and rename it. Names are lowercase and hyphenated, topic first:
conduction-plane-wall-element.svg. A series
shares a prefix and a number (cfd-history-1-separate,
-2-overlap…), and is built to be shown in order, so it shares a
canvas, a layout and a colour assignment. The folder is flat:
a diagram wanted by CFD and heat transfer has no correct topic subfolder.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="../framework/agDiagrams.css" type="text/css"?>
<!--
Created YYYY-MM-DD: what it is for.
THE TEACHING POINT. ...
STYLE. ... GEOMETRY. ... (anything a later edit will need)
-->
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1200 675" width="1200" height="675">
<title>What the diagram shows, as a real sentence.</title>
<desc>Optional: what the title cannot carry.</desc>
<rect class="ag-ground" x="0" y="0" width="100%" height="100%"/>
...the drawing...
</svg>
Every diagram is drawn on viewBox="0 0 1200 675": 16:9 like
the slide canvas, and about 90 mm tall at full A4 text width. Treat it as
the box, not a default to adjust. Diagrams that share a frame read as
a set.
| 1200 × 675 | The default. Full slide width, or full A4 text width. Use this. |
|---|---|
| 600 × 675 | Half width: one side of a two-column slide. Should be rare. |
| 1200 × 400 | Long and thin: a timeline, a spectrum, a sequence. |
| 600 × 1000 | Tall and narrow: a vertical stack, strata, a process running down the page. |
Leaving the default needs a reason about the shape of the content. The width is not a free choice. Strokes and text are in user units, so a 1200-wide box shown in a half-width column renders every line at half weight. Use 1200 for a diagram shown full width and 600 for one shown half width. Height follows the content. (The 2-D and 3-D conduction elements use 600 × 540 and 600 × 600: half-width companions cropped to their content.)
Why half width should be rare: columns stack on a phone and lose the pairing that justified them; written notes want a figure with explanation above and below rather than beside it; and in a lecture the thing next to a diagram should usually be your voice.
? button; save as Plain SVG. Afterwards,
check the file contains no style=, fill= or
stroke= attributes.<title> (the
accessible name a screen reader announces) and in the index.Add an entry to diagrams/diagrams.json with alt
and caption. The index exists for findability: grep it
rather than opening SVGs one by one. Building a deck from the command line
(convert.bat) reports diagrams missing from the index, entries
whose file has gone, and diagrams a deck uses that are not listed. The index is
a record, not the source: decks write their own alt text and captions, so keep
them in step by hand.

: Caption: what it means.
The leading slash means "from the site root"; the builder rewrites it for
the deck's depth. The builder embeds any .svg as
<object>, never <img>. An SVG inside
<img> renders in a secure static mode that refuses its
linked stylesheet, so it would arrive as black shapes.
Open the .svg directly in a browser: it should look finished.
Black shapes mean the stylesheet is not loading or a shape is unclassed (see
section 17).
A demo is an embeddable component: one concept, one
interaction, model or visualisation, designed to sit inside a lecture deck, a
web page or the VLE. It has no page title, header, navigation or footer, and
keeps its text short. The fuller explanation belongs in the teaching material
that embeds it. It lives at
teaching-demos/<topic>/<descriptive_name>.html,
mirroring the lecture that uses it.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Short descriptive title</title>
<link rel="stylesheet" href="../../framework/agTeachingDemos.css">
<style>
/* DEMO-LOCAL: arrangement only. No colours, weights or fonts here. */
.demo { display: flex; flex-wrap: wrap; gap: 1rem;
align-items: flex-start; max-width: 860px; }
.demo svg { flex: 1 1 340px; min-width: 0; height: auto;
max-width: 600px; max-height: 85vh; }
.demo-controls { flex: 0 0 200px; }
</style>
</head>
<body>
<div class="demo ag-demo">
<svg id="fig" viewBox="0 0 700 400" xmlns="http://www.w3.org/2000/svg"
role="img" aria-label="What the figure shows.">
<rect class="ag-metal ag-outline" .../>
<g id="arrows" class="ag-heat"></g>
<text class="ag-label" ...>Q in</text>
</svg>
<div class="demo-controls ag-controls">
<label for="iQ">heat rate Q</label>
<input type="range" id="iQ" min="1" max="5" step="0.1" value="3">
</div>
</div>
<script>
"use strict";
/* Header comment: the physics, the visual encodings, and why. */
</script>
</body>
</html>
.ag-demo. It sets the
house font and re-points the type sizes for the demo canvas (13 / 11 / 16
units for a canvas about 700 wide, the same proportions as a diagram's
22 / 17 / 28 at 1200). Forget it and the labels come out huge in a serif
font. A demo drawn on another canvas sets --ag-fs-label on its
own svg (cfd_cell_refinement.html, 1200 wide, uses 19px).color-mix() of
--ag-c-cold and --ag-c-hot, not with RGB arithmetic
in JavaScript, so the colours stay in the stylesheet.Cap the component at about 860px wide. Give the SVG a flex basis of 340px, a
max-width of about 600px and
max-height: 85vh. Inside an iframe, vh is
the iframe's own height, so the figure shrinks to fit whatever box the host
gives it instead of clipping. Trim dead space from the viewBox. A typical host
embed is about 840 × 460.
<label for> / <input
id> pair; a radio group is a <fieldset> with a
<legend>; a button group has role="group"
and a label, and toggles use aria-pressed.role="img" and an aria-label
(or aria-labelledby a <title>) saying what
it shows, kept up to date if the content changes.role="meter" with
aria-valuenow updated alongside the visual.aria-live="polite"
region.aria-hidden in the figure
and repeated in a visually hidden data table, which keeps hundreds of items
out of the keyboard sequence.ag-label-inverse; text in the control accent passes WCAG AA,
and the core drawing hues do not, so they are not used for small text on
white.Motion that carries the physics is essential and always animates: a particle jiggle that is the temperature (WCAG 2.3.3 exempts essential animation). Decorative motion respects the reduced-motion preference: marching dashes stop automatically. Sweeping whole-view motion (an animated pan-and-zoom) becomes an instant jump under the preference. The preference is an honour system: it stops nothing unless the page opts in. Windows surfaces it as Settings > Accessibility > Visual effects > Animation effects.
conductions_physics.html), with "last touched wins".
Setting a slider's .value from script does not fire its
input event, so the linking cannot loop.Assume students will poke at it. Demos are static pages with no server and
no stored data. Never build markup from anything a user can type: use
textContent, not innerHTML, for any text that did not
come from the demo's own constants.
::: {.demo src="/teaching-demos/heat-transfer/1D_conduction_sim.html" height="460"}
:::
The demo is live during the lecture. The working examples to copy from are
teaching-demos/heat-transfer/
(conductions_physics, 1D_conduction_sim,
convection_physics, conductivity_scale) and
teaching-demos/cfd/cfd_cell_refinement.
composite-wall.html predates the framework and is not an
example.
The palette is the easy half. What separates a designed set of drawings from an amateur one is that most of a good drawing is quiet and only the subject is at full strength. The neutrals are named for their job, because the name is the instruction.
A neutral is used exactly like a hue, stacked on a role:
class="ag-line ag-faint", class="ag-box ag-ghost". On
its own it does nothing. Each also resets tint and shade, so a ghost box inside
a blue group is still a ghost box.
Three weights, and they are not equal citizens: regular should carry about nine tenths of every drawing.
Values: --ag-sw-fine ,
--ag-sw-regular ,
--ag-sw-heavy .
ag-dashed adds a 7/5 dash to any stroke.
A shape takes a role class (how it is painted) and a hue class (which colour). Each hue provides a tint for large fills, a base for strokes and solids, and a shade for text sitting on the tint. Tint fill, base outline and shade text never need a contrast check.
| Role | Paints |
|---|---|
.ag-box | Tint fill, base outline, rounded corners. The workhorse. |
.ag-shape | The same paint, no corner radius: circles, ellipses, polygons, free paths. |
.ag-solid | Base fill, no outline. Also how to give one shape a computed colour from script: set --ag-h-base on it. |
.ag-line | Base stroke, no fill, round caps and joins. Lines, rules, data curves. |
.ag-connector | The shaft of an arrow. |
.ag-arrowhead | The head of an arrow (a filled polygon). |
.ag-label-hue | Text in the base colour. .ag-label-shade: text in the shade, for use on the tint. |
| Modifier | Effect |
|---|---|
.ag-fine .ag-heavy | Stroke weight. |
.ag-dashed | A 7/5 dash. |
.ag-translucent | Base colour at reduced fill opacity, for a schematic volume with geometry visible behind it. Paint each volume once rather than stacking translucent faces, which makes dark seams. |
Reused constantly, and that reuse is what creates the identity. Reach for these first. Deliberately muted: nothing here is a pure hue. Violet is deliberately absent because it belongs to the slide chrome.
For depiction, not distinction: when you draw a Ferrari it
has to be red. Do not use these to tell parts of a schematic apart; a schematic
wearing eight hues has no identity. The recorded exception is a data plot with
many series (cfd-residuals-convergence.svg), where each series
gets its own hue and a label in that hue.
Quiet and small, with air around it. Text set large is the fastest way to make a drawing look like a poster. Label a thing in the colour of the thing it names and a legend is rarely needed.
| Class | Use |
|---|---|
.ag-label | The default label. Ink. |
.ag-label-small | Annotations, ticks, subscripts. Muted. |
.ag-label-title | A heading inside a drawing. Usually unnecessary: the slide or caption has one. |
.ag-axis-label | Axis titles and tick labels: label size, axis colour. |
.ag-label-faint | Modifier: text that must not compete. |
.ag-label-hue / .ag-label-shade | Modifier: text in the hue's base / shade. |
.ag-label-inverse | Modifier: light text on a dark fill (iron, a solid muted block). |
.ag-math | Italic serif, for variables as they appear in print. |
.ag-axis-label-vertical | Rotates a y-axis title 90° about its own centre; place the text at its centre point. |
Sizes are user units and depend on the canvas. A diagram on 1200 uses
--ag-fs-label 22, --ag-fs-small 17,
--ag-fs-title 28. Inside .ag-demo the same classes
are 13, 11 and 16. Fonts are inherited from the svg (set by each
layer), never set on the label classes, which is what lets a maths
<text> pass its italic serif to a subscript
<tspan>.
An arrow is a stroked path plus a separate filled head, never an
SVG <marker>: browsers cannot reliably recolour marker
content from CSS. Use one head shape and size everywhere: copy the polygon and
rotate it.
<path class="ag-connector" d="M 100 100 H 280"/>
<polygon class="ag-arrowhead" points="292,100 276,92 276,108"/>
<!-- rotated: the head drawn pointing right at the origin, then placed -->
<polygon class="ag-arrowhead" points="0,0 -18,-9 -18,9"
transform="translate(976,268) rotate(-45)"/>
Heat is a hue, .ag-heat, the dark orange used for heat in every
diagram and demo. It holds the same values as terracotta, but in separate
variables. Heat is physics and terracotta is a schematic category (it means
"engineering" in the CFD diagrams), so recolouring one must not recolour the
other. Put it on the group:
<g class="ag-heat">
<path class="ag-connector" d="M 805 310 H 887"/>
<polygon class="ag-arrowhead" points="905,310 887,301 887,319"/>
</g>
<text class="ag-label ag-math ag-label-hue ag-heat">Q̇</text>
In a demo, add ag-marching to make the dashes march along a
connector, usually with ag-heavy. The speed is a variable, so it
can follow a physical magnitude (set on the svg or a group; lower is faster).
The animation stops automatically under the reduced-motion preference. It lives
in the demo layer because a diagram is static.
<g id="arrows" class="ag-heat">
<line class="ag-connector ag-heavy ag-marching" x1="28" y1="150" x2="85" y2="150"/>
<polygon class="ag-arrowhead" points="85,143 98,150 85,157"/>
</g>
fig.style.setProperty("--ag-march-speed", (1.6 / flux).toFixed(2) + "s");
Colours that are their meaning. They hold their own values and never borrow a schematic colour, so restyling the schematic palette cannot recolour the physics.
Material classes are pure fills; they say what a region is
made of and nothing more. Add .ag-outline to outline one (ink,
regular weight, via --ag-c-outline and
--ag-sw-outline, which a drawing can override separately).
CSS alone can only make flat fills in SVG; a metallic sheen needs a gradient
defined inside the SVG. Paste this block once, just inside the
<svg>, to make every .ag-metal shiny. Without it,
.ag-metal falls back to the flat grey automatically. The gradient
scales to each shape.
<defs>
<linearGradient id="agMetalGradient" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#e9edf1"/>
<stop offset="0.45" stop-color="#9daab6"/>
<stop offset="0.6" stop-color="#c6cdd5"/>
<stop offset="1" stop-color="#8b98a5"/>
</linearGradient>
</defs>
(The one place colour values appear in markup: a gradient's stops cannot be set from CSS in every browser. Copy the block exactly.)
.ag-metal on
that page is shiny, including ones in other SVGs. That is why this page forces
flat fills on its flat examples.A flat material fill can be recoloured per element by overriding its variable. Use these named tints rather than inventing colours, so the same metal is the same colour in every drawing:
<rect class="ag-metal ag-outline" style="--ag-c-metal: var(--ag-c-metal-copper)"/>
Tints work only on flat fills. With the metal gradient present, every metal
shares the one gradient, so a drawing that needs distinguishable metals leaves
the defs block out (as conductivity_scale.html does). New tints
are added only when a drawing needs them. Iron is dark enough that a label on
it needs ag-label-inverse.
.ag-heat: see section 10.
The two ends of a temperature colour scale. There is no class, because anything coloured by temperature computes its colour. Mix the two variables in CSS so the colours stay in the stylesheet:
el.style.setProperty("--ag-c-particle",
`color-mix(in srgb, var(--ag-c-hot) ${pct}%, var(--ag-c-cold))`);
Small dots for atoms and molecules: conduction lattices, gas models. The framework styles the dot, and any motion is the demo's JavaScript. Size, body colour and outline are variables, overridable on the svg, a group or one particle.
<circle class="ag-particle" cx="30" cy="20"/> <!-- radius comes from the stylesheet -->
The radius is set by the stylesheet: the CSS
r property overrides any r="" attribute, so resize
with --ag-particle-r, never the attribute.
Shiny particles. Like metal, particles become 3-D balls
when this block is in the SVG. The gradient derives its highlight and shade
from --ag-c-particle, so one override retints the whole ball:
<defs>
<radialGradient id="agParticleGradient" cx="0.33" cy="0.3" r="0.85">
<stop offset="0" style="stop-color: color-mix(in srgb, var(--ag-c-particle), #ffffff 80%)"/>
<stop offset="0.35" style="stop-color: var(--ag-c-particle)"/>
<stop offset="1" style="stop-color: color-mix(in srgb, var(--ag-c-particle), #000000 45%)"/>
</radialGradient>
</defs>
Recolouring. A shiny particle's gradient reads
--ag-c-particle where the defs block sits, not where the
particle is. So to recolour shiny particles, set the variable on the
<svg> itself; setting it on a group or a single particle
does nothing. Flat particles (no defs block) can be recoloured one by one,
which is why convection_physics.html omits the block. Browsers
without color-mix() (pre-2023) show flat particles.
Axes, gridlines and axis labels. Gridlines are the light reference lines
that divide or locate regions; they are as useful outside graphs (projecting a
layer boundary down onto a temperature profile). Draw them first, so they sit
under the data. Use one <polyline> for an L-shaped pair of
axes.
Data curves are ordinary lines with a hue:
class="ag-line ag-red". With one or two curves, use red then blue.
A plot with many series may give each its own specific hue, labelled in that
colour at the end of the curve, so no legend is needed.
.ag-demo at the width a demo figure
gets, so the text is at demo size. The same classes in a diagram come out at
diagram size.| Class | Variables | Notes |
|---|---|---|
.ag-axis | --ag-c-axis (muted), --ag-sw-axis | Axes and tick marks. |
.ag-axis-label | --ag-c-axis, --ag-fs-label | Axis titles and tick labels. |
.ag-axis-label-vertical | — | Rotates a y-axis title; place the text at its centre. |
.ag-gridline | --ag-c-gridline (hairline), --ag-sw-gridline (fine) | Add ag-dashed for a reference level (ambient, say). |
.ag-line + hue | hue variables | A data curve. |
The HTML control panel beside a demo: the one part of the system that styles
HTML rather than SVG. Wrap controls in .ag-controls; each slider is
a <label for> / <input type="range" id>
pair, with an optional .ag-readout for its live value.
<div class="ag-controls">
<label for="iQ">heat rate Q <span class="ag-readout" id="oQ">3.5</span></label>
<input type="range" id="iQ" min="1" max="5" step="0.1" value="3.5">
</div>
Qualitative demos give a slider a word label only (the second slider); quantitative ones show a readout with units (the first).
A value the user cannot adjust, typically one computed from the other
sliders. A filled bar with no thumb: the missing thumb is the
signal that this is a display, not a control. Update
aria-valuenow and the fill's width together.
<span class="ag-meter-label" id="hLabel">h</span>
<div class="ag-meter" role="meter" aria-labelledby="hLabel"
aria-valuemin="0" aria-valuemax="1" aria-valuenow="0.75">
<div class="ag-meter-fill" style="width: 75%"></div>
</div>
Control variables: --ag-c-control-accent (slider, readout and
meter fill; chosen for text contrast), --ag-c-control-text,
--ag-c-control-border and --ag-c-control-surface (for
demo-local panels, results boxes and buttons, so those follow the framework
too), and --ag-c-meter-track.
Not yet in the framework (each still local to one or two
demos; promote when a second demo needs it): results box, button group,
dropdown, radio row, the shared iframe layout, and the speedometer gauge
(convection_physics.html).
| Class | File | Meaning |
|---|---|---|
ag-ink ag-muted ag-faint ag-ghost | Drawing | Neutral hues: the hierarchy. Stack on a role. |
ag-blue ag-terracotta ag-green | Drawing | Core hues: reach for these first. |
ag-highlight | Drawing | One thing per drawing. |
ag-red ag-orange ag-amber ag-olive ag-lime ag-teal ag-cyan ag-indigo ag-violet ag-magenta ag-brown ag-slate | Drawing | Specific hues, for depiction. |
ag-heat | Drawing | Heat, everywhere. |
ag-metal ag-water ag-air ag-insulation ag-brick ag-wood ag-plastic ag-stone | Drawing | Material fills. |
ag-outline | Drawing | Outline a material region. |
ag-particle | Drawing | An atom or molecule. |
ag-box ag-shape ag-solid ag-line | Drawing | Roles: how a shape is painted. |
ag-connector ag-arrowhead | Drawing | Arrow shaft and head. |
ag-axis ag-gridline | Drawing | Graph strokes. |
ag-label ag-label-small ag-label-title ag-axis-label | Drawing | Text sizes. |
ag-label-faint ag-label-hue ag-label-shade ag-label-inverse | Drawing | Text colour modifiers. |
ag-math ag-axis-label-vertical | Drawing | Maths font; vertical axis title. |
ag-fine ag-heavy ag-dashed ag-translucent | Drawing | Stroke and fill modifiers. |
ag-ground | Diagrams | The card a diagram sits on. First element. |
ag-demo | Demos | The demo component root: font and demo type sizes. |
ag-controls ag-readout | Demos | Control panel and live value. |
ag-meter ag-meter-fill ag-meter-label | Demos | Read-only meter. |
ag-marching | Demos | Marching dashes. |
Values are read from the stylesheets as this page loads. Change one in the CSS and it changes here too.
| Variable | Value | Purpose |
|---|---|---|
| Foundations (agDrawing.css) | ||
--ag-font-ui | Labels, controls. | |
--ag-font-mono | Readouts. | |
--ag-font-math | Maths variables. | |
--ag-sw-fine / -regular / -heavy | / / | The three line weights. |
--ag-fs-label / -small / -title | / / | Type sizes on the 1200 canvas. |
… inside .ag-demo | / / | Type sizes on the demo canvas (agTeachingDemos.css). |
--ag-box-radius | Corners of ag-box. | |
| Colour (agDrawing.css) | ||
--ag-c-ink … --ag-c-hairline | section 6 | The neutrals. |
--ag-c-<hue>, -tint, -shade | section 8 | Every hue, e.g. --ag-c-blue-tint. |
--ag-h-tint / -base / -shade | (set by hue classes) | Carrier variables the roles read. Set --ag-h-base from script for a computed colour. |
--ag-c-heat, -tint, -shade | Heat. | |
--ag-c-cold / --ag-c-hot | / | Ends of the temperature scale. |
--ag-c-metal -water -air -insulation -brick -wood -plastic -stone | section 11 | Material fills. |
--ag-c-metal-iron -titanium -aluminium -gold -copper | section 11 | Named tints. |
--ag-c-outline / --ag-sw-outline | / | Material outline (points at ink and regular). |
--ag-c-particle / -outline, --ag-sw-particle, --ag-particle-r | / , , | Particle body, outline, outline width, radius. |
--ag-c-axis / --ag-sw-axis | / | Axes (points at muted). |
--ag-c-gridline / --ag-sw-gridline | / | Gridlines (points at hairline and fine). |
--ag-c-inverse | Text on a dark fill. | |
--ag-translucent-opacity | Fill opacity of ag-translucent. | |
| Diagram layer (agDiagrams.css) | ||
--ag-c-ground / --ag-c-ground-border / --ag-ground-radius | / / | The ground. Set --ag-c-ground to transparent to drop it from every diagram at once. |
| Demo layer (agTeachingDemos.css) | ||
--ag-c-control-accent | Sliders, readouts, meter fill. | |
--ag-c-control-text / -border / -surface | / / | Control text, borders, panel backgrounds. |
--ag-c-meter-track | Empty part of a meter. | |
--ag-march-speed | Seconds per dash cycle (lower is faster). | |
| Symptom | Cause and fix |
|---|---|
| A whole diagram is black shapes on white. | The stylesheet is not loading. It was embedded as <img> (use <object>; the deck builder does), or the xml-stylesheet href is wrong for where the file sits. |
| One shape is black. | It has no class. Give it the class that says what it is. |
| One shape ignores a restyle. | It carries style=, fill= or stroke= (Inkscape). Delete the attribute. |
| Every metal on a page is shiny, or tints are ignored. | The metal-gradient defs block is somewhere in the document; gradients resolve document-wide. |
| Demo labels are huge, in a serif font. | The demo's wrapper is missing class="ag-demo". |
| A stacked class has no effect (a heavy line stays regular, a hue label stays ink). | Source order in agDrawing.css: a role or text rule has ended up below the modifier it should lose to. Modifiers stay last; colour modifiers come after size classes. |
| A ghost box comes out blue. | Not since 2026-10-09: neutrals now reset tint. If it happens, a neutral rule has lost its tint line. |
| Marching dashes do not move. | The reduced-motion preference is on (Windows: Animation effects off). Intended. |
| Particles are flat, not shiny, or temperature colours are missing. | The browser predates color-mix() (2023). |
convert.bat warns about a diagram. | It is missing from diagrams/diagrams.json, or listed but gone. |
Until 2026-10-09 the diagrams and the demos had separate stylesheets with
separate names. Older entries in the CLAUDE.md log use the old
names; this is the mapping.
| Old | Now |
|---|---|
ag-d-* (every diagram class) | ag-*: ag-d-box is ag-box, ag-d-ground is ag-ground, and so on |
ag-d-terracotta on heat arrows | ag-heat |
ag-d-fill-ink … -ghost | ag-solid + a neutral |
ag-line-thin / -medium / -thick | ag-line ag-fine / ag-line / ag-line ag-heavy |
ag-heat-arrow + ag-heat-arrow-head | ag-connector ag-heavy ag-marching + ag-arrowhead, inside ag-heat |
ag-graph-label | ag-label |
ag-default-curve1 / 2 | ag-line ag-red / ag-line ag-blue |
--ag-heat-arrow-speed | --ag-march-speed |
--ag-fs-axis-label | --ag-fs-label |
--ag-sw-thin / -medium / -thick | --ag-sw-fine / -regular / -heavy |
--ag-d-* variables | --ag-c-* for colours (--ag-d-ink is --ag-c-ink), --ag-h-* for hue carriers |
--ag-c-line, --ag-c-graph-label, --ag-c-curve1/2, --ag-sw-arrow, --ag-c-heat-arrow | Retired: ink, ag-label with a colour modifier, hue classes, ag-heavy, ag-heat |
--ag-c-meter-border | --ag-c-control-border |
agTeachingDemosGuide.html, agDiagramsGuide.html | This page |
Why anything is the way it is (the motion policy, the
canvas, the palettes, every bug and its fix) is recorded in the design
decisions log in CLAUDE.md at the repository root. That log is the
project's memory; this page is the manual.