Syntax
Code is mostly ink. Plain text, names and calls take the neutral inks, punctuation steps back, comments recede further; colour marks only what a reader scans for, in the semantic tones' low chroma, with the accent on keywords alone. Every role sits on the theme's ramp, so it flips with light and dark, follows the contrast setting, and reads at AA on the code surface (the base text at AAA).
Inks
| x = y | Plain code, and anything no grammar names | |
| client | A name in scope: a variable, a parameter | |
| list() | A call or a definition: the strong ink | |
| return | Where structure starts: the accent, the one warm hue | |
| <div> | A markup tag: the keyword ink | |
| "ep003" | A literal you wrote: sage, the success tone | |
| 0.82 | A number: violet, the help tone | |
| true | A value the language fixes: the number ink | |
| "verdict": | A key or a field: slate, the info tone | |
| Verdict | A type or a class: the property ink | |
| href= | A markup attribute: the property ink | |
| = | => | An operator: neutral, a step back | |
| { } , : | Brackets and separators: the operator ink | |
| # why | A comment: the subtle ink, in italic | |
| @@ | What the grammar refuses: danger, underlined |
Block
A code block sits in the inset well, the surface the inks are measured on. Its selection, line highlight, gutter and caret are roles too, so an editor and a static block read the same.
| The block: the inset well | |
| Selected text: the accent wash | |
| A highlighted line: the hover wash | |
| Line numbers: the subtle ink | |
| The caret: the accent ink |
Adapters
Highlighters never restyle tokens: q-design-ui/syntax hands each
one the roles in the shape it takes.
shikiTheme | A TextMate theme for Shiki, its colours var(--q-syntax-*). The landing’s markdown. |
expressiveCodeSyntax | The same theme for Expressive Code, which wants hex: placeholders it writes back as roles. The docs. |
lezerRoles | Lezer tag names to roles, for a CodeMirror HighlightStyle. The app’s editors. |
Examples
{
"episode_id": "ep003",
"verdict": "REMOVE",
"score": 0.82,
"kept": false
}Keys in slate, values by kind; the punctuation recedes.
from qualia import Client
# every dataset in one project
client = Client()
for ds in client.datasets.list(project="arm-pick"):
print(ds.name)The accent marks keywords only; the call itself is the strong ink.
type Verdict = 'KEEP' | 'REMOVE';
export function judge(score: number): Verdict {
return score >= 0.5 ? 'KEEP' : 'REMOVE';
}Types share the property ink: the names a schema declares.