feat: preview H1 pops as a theme-colored filled bar
191eed413b2229d4a3c5a5df73d17e46158fbe67
humdrum <me@humdrum.me> · 2026-06-29 08:44
parent 6441106b
feat: preview H1 pops as a theme-colored filled bar H1 renders with the heading color as its background and the paper as its text, bold — a distinct landmark that pops, in theme-appropriate colors (blue on flexoki, pink on charm). H2–H6 stay colored text on the theme background.
1 files changed
internal/preview/preview.go +8 −2
@@ -35,13 +35,19 @@ cfg.CodeBlock.Chroma = nil
cfg.CodeBlock.Color = &code
cfg.Code.Color = &code
- // Prose + headings + links in theme colors. Clear H1's purple background.
+ // Prose + headings + links in theme colors.
cfg.Document.Color = &text
cfg.Text.Color = &text
- for _, h := range []*ansi.StyleBlock{&cfg.Heading, &cfg.H1, &cfg.H2, &cfg.H3, &cfg.H4, &cfg.H5, &cfg.H6} {
+ // H2–H6 (and the base Heading) are colored text on the theme background.
+ for _, h := range []*ansi.StyleBlock{&cfg.Heading, &cfg.H2, &cfg.H3, &cfg.H4, &cfg.H5, &cfg.H6} {
h.Color = &heading
h.BackgroundColor = &bg
}
+ // H1 pops as a filled bar: heading-color background, paper text, bold.
+ yes := true
+ cfg.H1.Color = &bg
+ cfg.H1.BackgroundColor = &heading
+ cfg.H1.Bold = &yes
cfg.Link.Color = &link
cfg.LinkText.Color = &link
}