todo.txt
Your todo.txt file as a list you can scan: priorities in colour, done tasks struck through, projects as chips.
What it shows
Give every line a look, then let a line's start change it.
What you learn
A rule that matches any line, more exact rules that win by how a line starts, one class every task shares, a badge drawn from a custom property, tags that end at a space, a palette with dark shades.
Try this
- Change (C) to (A) on the birthday line, and its badge turns red and the task bold.
Call the plumber about the dripping tap +House @phone due:2026-09-12 before five
Pay the council tax +Admin @laptop due:2026-09-15 by Monday
Draft the club newsletter +Club @laptop for Friday
Book the van for the allotment open day +Club @phone due:2026-09-20 the long one
Renew the car insurance +Admin @laptop due:2026-09-28 get two quotes first
Book a table for Sam's birthday +Family @phone this week
Sort the loft boxes for the charity shop +House @home one weekend
Return the library books @town when passing
Buy picture hooks @town for the hall
2026-09-09 Renew passport +Admin @town done early
2026-09-08 Cancel the old broadband contract +Admin @phone confirmed by email
How it's made. Each line is one task. A letter in brackets at its start sets the priority, and an x marks it done +HowItsMade see Source
A word after a plus sign or an at sign becomes a chip. Every line has group div.todo-list, so the tasks gather into one list +HowItsMade see Source
Try it. Change (C) to (A) on the birthday line, and its badge turns red +TryIt now
Try it. Put x and a space at the start of a task, and it is struck through with a tick +TryIt now
Try it. Add +Garden to the picture hooks line, and a new purple chip appears +TryIt now
Next, open the Org rulebook. It keeps a whole plan with headlines and dates +TryIt later
~~~ selfscribe
# todo.txt: one task per line, the plain-text to-do format. Use it with: use todo-txt
# Lesson: Give every line a look, then let a line's start change it.
# You learn: a rule that matches any line, more exact rules that win by how a line starts, one class every task shares, a badge drawn from a custom property, tags that end at a space, a palette with dark shades.
# Try this: change (C) to (A) on the birthday line, and its badge turns red and the task bold.
# summary: Your todo.txt file as a list you can scan: priorities in colour, done tasks struck through, projects as chips.
# category: syntax
set title todo.txt
# ---- Colours, each with its shade for dark pages -------------------------------------
palette
urgent #c92a2a dark #ff8787
soon #d9480f dark #ffa94d
later #1c64d8 dark #74a7ff
done #2b8a3e dark #69db7c
project #6741d9 dark #b197fc
context #0b7f86 dark #3bc9db
# ---- Any line: a task. The rules after it win when a line starts with (A), (B), (C) or x -
# Every task shares one look, and every line joins one list. A priority or a done task
# sets --tone and --mark, and the class draws them as a round badge on the left.
class todo-list { margin: 0 0 1.6em; border: 1px solid color-mix(in srgb, currentColor 12%, transparent); border-radius: 12px; overflow: hidden; font: 0.95em/1.5 var(--doc-font-ui) }
class todo-line { position: relative; padding: 0.6em 0.9em 0.6em 3em; border-bottom: 1px solid color-mix(in srgb, currentColor 8%, transparent) }
class todo-line::before { content: var(--mark, ""); position: absolute; left: 0.85em; top: 0.62em; display: grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 50%; background: color-mix(in srgb, var(--tone, transparent) 18%, transparent); color: var(--tone, currentColor); font: 700 0.8em/1 var(--doc-font-ui) }
line _ -> div.todo-line group div.todo-list as td-task
line (A) _ -> div.todo-line.a group div.todo-list { --tone: var(--urgent); --mark: "A"; font-weight: 600 } as td-a
line (B) _ -> div.todo-line.b group div.todo-list { --tone: var(--soon); --mark: "B" } as td-b
line (C) _ -> div.todo-line.c group div.todo-list { --tone: var(--later); --mark: "C" } as td-c
line x _ -> div.todo-line.done group div.todo-list { --tone: var(--done); --mark: "✓"; text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent) } as td-done
class done { color: color-mix(in srgb, currentColor 55%, transparent) }
# ---- +Project, @context and due:date inside a task: coloured chips ---------------------
# Tags end at a space, so write them before the end of the line (or add a trailing space).
class td-chip { padding: 0.1em 0.25em 0.1em 0.5em; margin-right: 0.15em; border-radius: 999px; font-size: 0.85em; font-weight: 500 }
inline +_\ -> span.td-chip.project keep { background: color-mix(in srgb, var(--project) 13%, transparent); color: var(--project) } as td-project
inline @_\ -> span.td-chip.context keep { background: color-mix(in srgb, var(--context) 13%, transparent); color: var(--context) } as td-context
inline due:_\ -> span.td-chip.due keep { border: 1px solid color-mix(in srgb, var(--urgent) 45%, transparent); color: var(--urgent); font-variant-numeric: tabular-nums } as td-due
~~~
(A) Call the plumber about the dripping tap +House @phone due:2026-09-12 before five
(A) Pay the council tax +Admin @laptop due:2026-09-15 by Monday
(B) Draft the club newsletter +Club @laptop for Friday
(B) Book the van for the allotment open day +Club @phone due:2026-09-20 the long one
(B) Renew the car insurance +Admin @laptop due:2026-09-28 get two quotes first
(C) Book a table for Sam's birthday +Family @phone this week
(C) Sort the loft boxes for the charity shop +House @home one weekend
Return the library books @town when passing
Buy picture hooks @town for the hall
x 2026-09-09 Renew passport +Admin @town done early
x 2026-09-08 Cancel the old broadband contract +Admin @phone confirmed by email
How it's made. Each line is one task. A letter in brackets at its start sets the priority, and an x marks it done +HowItsMade see Source
A word after a plus sign or an at sign becomes a chip. Every line has group div.todo-list, so the tasks gather into one list +HowItsMade see Source
(B) Try it. Change (C) to (A) on the birthday line, and its badge turns red +TryIt now
(B) Try it. Put x and a space at the start of a task, and it is struck through with a tick +TryIt now
(B) Try it. Add +Garden to the picture hooks line, and a new purple chip appears +TryIt now
(C) Next, open the Org rulebook. It keeps a whole plan with headlines and dates +TryIt later