Documentation
¶
Overview ¶
Command gencodecss writes internal/web/static/code.css, the stylesheet of the code blocks that internal/markdown renders: the block itself and the colour of each hl- class of the highlighted tokens. It is run by go generate (see internal/markdown/code.go) and its output is committed; a test fails when the committed file is out of date.
The colours are not written here. Each token class takes the colour of the family it belongs to, as var(--code-keyword), var(--code-string) and so on, and app.css sets those custom properties for the light and the dark theme (SPEC D57), so the theme is chosen in one place and a block follows it with no rule of its own. Chroma's token types map to a family by their kind: every Keyword* to the keyword, every String* to the string, and so on (family).