showcase
- v0.2.4
- 37 commits
- 1 branch
- 6 tags
- updated
- CI 2/2
style: raise contrast with layered surfaces, brighter text and accent-bright
Showing 23 changed files with 439 additions and 92 deletions.
docs/decisions.md
+51 −0
@@ -204,3 +204,54 @@ details are in `docs/theme.md`. This replaces the spec's original204204- **Freshness:** ages within a day, week or month get warmer colours.205205- **Stylesheet cache-busting:** the CSS (and `copy.js`) URLs carry a hash of206206 `style.css`, so caches never serve a stale stylesheet.207208## Polish pass 3209210### Phase 1: contrast and type211212All changes are in part 2 of `style.css`. Saturn's tokens in part 1 are213untouched, and every new value is a `color-mix()` of them, so ink, wine,214plum, teal and flexoki get the same steps as moss.215216- **Layers, darkest first:** `--page` (background-dark 55% toward black),217 `--box` (60% background-dark, 40% surface), then `--box-head` and `--hover`218 (surface with 4–5% of the heading colour). The latest-commit strip and219 README table headers use `--box-head` too. Box edges use `--edge`, which is220 brighter than saturn's `--borders`. Dividers inside boxes use the softer221 `--rule`, and controls use `--line`.222- **Text:** `--body-text` (45% body, 55% headings) for body copy,223 descriptions and the tree's commit column. File names, repo names, commit224 subjects and counts use `--text-headings` at weight 500–600, and225 `--text-secondary` is kept for metadata. Ages, sizes, counts and stats use226 tabular figures. "No description." on repo cards stays dim227 (`repo-card-desc--none`).228- **Accent:** `--accent-bright` (accent 82%, white 18%) is used for hovers,229 active tabs, breadcrumb links, the profile name, the 404 and one shared230 `:focus-visible` ring (`a`, `button`, `summary`, `input`). `--accent` stays231 for fills: the primary button, the heatmap, the language bar and the232 `:target` line edge.233- **Depth:** boxes and repo cards get `--depth` (a faint top highlight plus234 a soft drop shadow), and box heads repeat the highlight, since their235 background hides the box's. The profile avatar has a faint accent glow made236 of two spread box-shadows. It sits only behind the avatar, with no gradient237 behind text.238- **Contrast:** `web/contrast_test.go` reads the tokens from `style.css`,239 evaluates the `color-mix()` chains in OKLab and fails below 4.5:1. Run240 `go test -v -run Contrast ./web` to see the ratios. At the time of writing:241242 | text on | moss | ink | wine | plum | teal | flexoki |243 | -------------------- | ----- | ----- | ----- | ----- | ----- | ------- |244 | headings / page | 17.68 | 17.79 | 17.82 | 17.83 | 17.68 | 18.08 |245 | headings / box-head | 11.20 | 12.12 | 12.35 | 12.59 | 11.12 | 13.62 |246 | body / box | 12.68 | 13.30 | 13.45 | 13.56 | 12.64 | 14.62 |247 | body / hover | 10.40 | 11.25 | 11.45 | 11.68 | 10.32 | 12.61 |248 | secondary / page | 7.45 | 7.49 | 7.51 | 7.51 | 7.45 | 7.61 |249 | secondary / box | 5.90 | 6.18 | 6.25 | 6.30 | 5.88 | 6.79 |250 | secondary / box-head | 4.72 | 5.11 | 5.20 | 5.30 | 4.68 | 5.74 |251 | secondary / hover | 4.83 | 5.23 | 5.32 | 5.43 | 4.80 | 5.86 |252 | accent-bright / box | 7.94 | 7.33 | 7.69 | 7.98 | 8.30 | 7.61 |253254 The tightest pair is metadata on box heads in teal and moss (about 4.7:1).255 That's why heads and hovers only take 4–5% of the heading colour. Line256 numbers keep saturn's dimmed look (opacity 0.55) and are exempt, as257 decoration next to the code.
testdata/golden/index.html
+3 −3
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>Daniel Daum</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body>1212<a class="skip-link" href="#site-main">skip to content</a>@@ -66,7 +66,7 @@6666 </a>6767 <a class="repo-card" href="/repo-b/">6868 <span class="repo-card-name"><svg class="icon icon-book" width="16" height="16" fill="none" stroke="currentColor" aria-hidden="true" focusable="false"><use href="#i-book"></use></svg>repo-b</span>69 <span class="repo-card-desc">No description.</span>69 <span class="repo-card-desc repo-card-desc--none">No description.</span>7070 <span class="repo-card-meta"><span><span class="dot lang-6" aria-hidden="true"></span>Shell</span>7171 <span>Updated <time class="" datetime="2026-08-01T12:00:00Z">3 months ago</time></span>7272 </span>
testdata/golden/repo-a/blob/README.md.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>README.md · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/blob/big.txt.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>big.txt · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/blob/cmd/hello/main.go.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>cmd/hello/main.go · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/blob/data.bin.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>data.bin · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/blob/docs/logo.png.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>docs/logo.png · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/branches/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>branches · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/commit-latest.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>Add changelog · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/index.html
+2 −2
@@ -6,8 +6,8 @@66<title>repo-a</title>77<meta name="go-import" content="daum.dev/repo-a git https://daum.dev/repo-a.git">88<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>9<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">10<script src="/static/copy.js?v=4dcf87d14b" defer></script>9<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">10<script src="/static/copy.js?v=87a1f33b10" defer></script>1111</head>1212<body class="page--code">1313<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/log/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>commits · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/packages/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>packages · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/pulls/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>pulls · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/releases/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>releases · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/tags/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>tags · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/tree/cmd/hello/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>cmd/hello · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/tree/docs/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>docs · repo-a</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-b/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>repo-b</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-b/log/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>commits · repo-b</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-b/releases/index.html
+2 −2
@@ -5,8 +5,8 @@55<meta name="viewport" content="width=device-width, initial-scale=1">66<title>releases · repo-b</title>77<link rel="preload" href="/static/fonts/geistpixel/GeistPixel-Square.woff2" as="font" type="font/woff2" crossorigin>8<link rel="stylesheet" href="/static/style.css?v=4dcf87d14b">9<script src="/static/copy.js?v=4dcf87d14b" defer></script>8<link rel="stylesheet" href="/static/style.css?v=87a1f33b10">9<script src="/static/copy.js?v=87a1f33b10" defer></script>1010</head>1111<body class="page--code">1212<a class="skip-link" href="#site-main">skip to content</a>
web/contrast_test.goadded
+227 −0
@@ -0,0 +1,227 @@1package web23import (4 "fmt"5 "math"6 "regexp"7 "strconv"8 "strings"9 "testing"10)1112// TestContrast checks that text tokens meet WCAG AA (4.5:1) on the layers13// they sit on, in every palette. It reads the tokens from style.css: saturn's14// moss values from `html {`, each `[data-theme]` override, then the derived15// daum.dev tokens in part 2's `:root {`, and evaluates their color-mix()16// chains in OKLab like a browser does. Run with -v to print the ratios.17func TestContrast(t *testing.T) {18 css, err := FS.ReadFile("static/style.css")19 if err != nil {20 t.Fatal(err)21 }22 s := string(css)23 part2 := strings.Index(s, "part 2: daum.dev only")24 if part2 < 0 {25 t.Fatal("no part 2 marker in style.css")26 }27 base := block(t, s, "\nhtml {")28 derived := block(t, s[part2:], ":root {")2930 pairs := []struct{ fg, bg string }{31 {"--text-headings", "--page"}, {"--text-headings", "--box"}, {"--text-headings", "--box-head"}, {"--text-headings", "--hover"},32 {"--body-text", "--page"}, {"--body-text", "--box"}, {"--body-text", "--box-head"}, {"--body-text", "--hover"},33 {"--text-secondary", "--page"}, {"--text-secondary", "--box"}, {"--text-secondary", "--box-head"},34 {"--text-secondary", "--hover"}, {"--text-secondary", "--surface"}, {"--text-secondary", "--background-dark"},35 {"--accent-bright", "--page"}, {"--accent-bright", "--box"}, {"--accent-bright", "--hover"},36 {"--accent", "--page"}, {"--background-dark", "--accent"},37 {"--syn-constant", "--box"}, {"--add", "--box"}, {"--del", "--box"},38 }39 var report strings.Builder40 fmt.Fprintf(&report, "%-18s %-18s", "text", "on")41 themes := []string{"moss", "ink", "wine", "plum", "teal", "flexoki"}42 for _, th := range themes {43 fmt.Fprintf(&report, " %7s", th)44 }45 report.WriteString("\n")46 for _, p := range pairs {47 fmt.Fprintf(&report, "%-18s %-18s", p.fg, p.bg)48 for _, th := range themes {49 vars := map[string]string{}50 for k, v := range base {51 vars[k] = v52 }53 if th != "moss" {54 for k, v := range block(t, s, `[data-theme="`+th+`"] {`) {55 vars[k] = v56 }57 }58 for k, v := range derived {59 vars[k] = v60 }61 r := ratio(eval(t, vars, "var("+p.fg+")"), eval(t, vars, "var("+p.bg+")"))62 fmt.Fprintf(&report, " %7.2f", r)63 if r < 4.5 {64 t.Errorf("%s: %s on %s is %.2f:1, below 4.5:1", th, p.fg, p.bg, r)65 }66 }67 report.WriteString("\n")68 }69 t.Log("contrast ratios\n" + report.String())70}7172var declRe = regexp.MustCompile(`(--[\w-]+)\s*:\s*([^;]+);`)7374// block returns the custom properties declared in the first rule that75// starts with head.76func block(t *testing.T, s, head string) map[string]string {77 t.Helper()78 i := strings.Index(s, head)79 if i < 0 {80 t.Fatalf("style.css has no %q block", head)81 }82 body := s[i+len(head):]83 body = body[:strings.Index(body, "}")]84 vars := map[string]string{}85 for _, m := range declRe.FindAllStringSubmatch(body, -1) {86 vars[m[1]] = strings.TrimSpace(m[2])87 }88 return vars89}9091type rgb [3]float64 // sRGB, 0..19293// eval resolves a colour expression: var(), #hex, black, white and94// color-mix(in oklab, …).95func eval(t *testing.T, vars map[string]string, e string) rgb {96 t.Helper()97 e = strings.TrimSpace(e)98 switch {99 case strings.HasPrefix(e, "var("):100 name := strings.TrimSuffix(strings.TrimPrefix(e, "var("), ")")101 v, ok := vars[name]102 if !ok {103 t.Fatalf("unknown token %s", name)104 }105 return eval(t, vars, v)106 case strings.HasPrefix(e, "#") && len(e) == 7:107 var c rgb108 for i := range c {109 n, _ := strconv.ParseUint(e[1+2*i:3+2*i], 16, 8)110 c[i] = float64(n) / 255111 }112 return c113 case e == "black":114 return rgb{}115 case e == "white":116 return rgb{1, 1, 1}117 case strings.HasPrefix(e, "color-mix(in oklab,"):118 args := split(e[len("color-mix(in oklab,") : len(e)-1])119 if len(args) != 2 {120 t.Fatalf("color-mix needs two colours: %s", e)121 }122 ca, pa := percent(args[0])123 cb, pb := percent(args[1])124 switch {125 case pa < 0 && pb < 0:126 pa, pb = 50, 50127 case pa < 0:128 pa = 100 - pb129 case pb < 0:130 pb = 100 - pa131 }132 if pa+pb != 100 {133 t.Fatalf("color-mix percentages must add to 100 here: %s", e)134 }135 a, b := oklab(eval(t, vars, ca)), oklab(eval(t, vars, cb))136 var m [3]float64137 for i := range m {138 m[i] = a[i]*pa/100 + b[i]*pb/100139 }140 return fromOklab(m)141 }142 t.Fatalf("can't evaluate colour %q", e)143 return rgb{}144}145146// split cuts at top-level commas.147func split(s string) []string {148 var out []string149 depth, start := 0, 0150 for i, r := range s {151 switch r {152 case '(':153 depth++154 case ')':155 depth--156 case ',':157 if depth == 0 {158 out = append(out, s[start:i])159 start = i + 1160 }161 }162 }163 return append(out, s[start:])164}165166// percent splits "var(--x) 40%" into the colour and 40, or -1 if absent.167func percent(s string) (string, float64) {168 s = strings.TrimSpace(s)169 if i := strings.LastIndex(s, " "); i > 0 && strings.HasSuffix(s, "%") && !strings.Contains(s[i:], ")") {170 p, err := strconv.ParseFloat(s[i+1:len(s)-1], 64)171 if err == nil {172 return strings.TrimSpace(s[:i]), p173 }174 }175 return s, -1176}177178func lin(c float64) float64 {179 if c <= 0.04045 {180 return c / 12.92181 }182 return math.Pow((c+0.055)/1.055, 2.4)183}184185func gam(c float64) float64 {186 c = math.Max(0, math.Min(1, c))187 if c <= 0.0031308 {188 return c * 12.92189 }190 return 1.055*math.Pow(c, 1/2.4) - 0.055191}192193// oklab and fromOklab follow Björn Ottosson's reference matrices.194func oklab(c rgb) [3]float64 {195 r, g, b := lin(c[0]), lin(c[1]), lin(c[2])196 l := math.Cbrt(0.4122214708*r + 0.5363325363*g + 0.0514459929*b)197 m := math.Cbrt(0.2119034982*r + 0.6806995451*g + 0.1073969566*b)198 s := math.Cbrt(0.0883024619*r + 0.2817188376*g + 0.6299787005*b)199 return [3]float64{200 0.2104542553*l + 0.7936177850*m - 0.0040720468*s,201 1.9779984951*l - 2.4285922050*m + 0.4505937099*s,202 0.0259040371*l + 0.7827717662*m - 0.8086757660*s,203 }204}205206func fromOklab(c [3]float64) rgb {207 l := math.Pow(c[0]+0.3963377774*c[1]+0.2158037573*c[2], 3)208 m := math.Pow(c[0]-0.1055613458*c[1]-0.0638541728*c[2], 3)209 s := math.Pow(c[0]-0.0894841775*c[1]-1.2914855480*c[2], 3)210 return rgb{211 gam(4.0767416621*l - 3.3077115913*m + 0.2309699292*s),212 gam(-1.2684380046*l + 2.6097574011*m - 0.3413193965*s),213 gam(-0.0041960863*l - 0.7034186147*m + 1.7076147010*s),214 }215}216217func luminance(c rgb) float64 {218 return 0.2126*lin(c[0]) + 0.7152*lin(c[1]) + 0.0722*lin(c[2])219}220221func ratio(a, b rgb) float64 {222 la, lb := luminance(a), luminance(b)223 if la < lb {224 la, lb = lb, la225 }226 return (la + 0.05) / (lb + 0.05)227}
web/static/style.css
+121 −52
@@ -1430,17 +1430,64 @@ footer nav a,14301430 --pixel: "Geist Pixel", ui-monospace, monospace;14311431 --radius: 10px;14321432 --radius-sm: 6px;1433 --box: color-mix(in oklab, var(--background-dark) 55%, var(--surface));1434 --hover: color-mix(in oklab, var(--surface) 80%, var(--background-dark));1435 --line: color-mix(in oklab, var(--borders) 75%, var(--text-secondary) 25%);14361433 --add: var(--syn-string);14371434 --del: var(--syn-variable);14351436 /* layers, darkest first: a near-neutral page, tinted boxes, lighter1437 box heads and hovers. Derived from saturn's tokens, so every palette1438 gets the same steps. web/contrast_test.go checks the text on them. */1439 --page: color-mix(in oklab, var(--background-dark) 55%, black);1440 --box: color-mix(in oklab, var(--background-dark) 60%, var(--surface));1441 --box-head: color-mix(in oklab, var(--surface) 95%, var(--text-headings));1442 --hover: color-mix(in oklab, var(--surface) 96%, var(--text-headings));1443 --edge: color-mix(in oklab, var(--borders) 62%, var(--text-secondary));1444 --rule: color-mix(in oklab, var(--borders) 82%, var(--text-secondary));1445 --line: color-mix(in oklab, var(--borders) 58%, var(--text-secondary));14461447 /* text: content near the heading colour, --text-secondary for metadata */1448 --body-text: color-mix(in oklab, var(--text-body) 45%, var(--text-headings));1449 --accent-bright: color-mix(in oklab, var(--accent) 82%, white);14501451 /* depth: a faint top highlight and a soft drop shadow */1452 --highlight: inset 0 1px 0 rgb(255 255 255 / 0.045);1453 --depth: var(--highlight), 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.7);14381454}1439145514401456body {14411457 font-family: var(--ui);14421458 font-size: 15px;14431459 line-height: 1.55;1460 color: var(--body-text);1461 background-color: var(--page);1462}14631464p {1465 color: var(--body-text);1466}14671468/* names and numbers */1469time,1470.count,1471.stat,1472.f-size,1473.f-age,1474.lang-pct,1475.diffstat,1476.diff-summary,1477.file-stats,1478.repo-card-meta,1479.heat-body,1480.ln {1481 font-variant-numeric: tabular-nums;1482}14831484/* one focus ring for everything interactive */1485a:focus-visible,1486button:focus-visible,1487summary:focus-visible,1488input:focus-visible {1489 outline: 2px solid var(--accent-bright);1490 outline-offset: 2px;14441491}1445149214461493body.page--code {@@ -1535,7 +1582,14 @@ img.ficon {1535158215361583.avatar-xs { width: 20px; height: 20px; }15371584.avatar-sm { width: 24px; height: 24px; }1538.avatar-lg { width: 88px; height: 88px; box-shadow: 0 0 0 1px var(--borders); }1585.avatar-lg {1586 width: 88px;1587 height: 88px;1588 box-shadow:1589 0 0 0 1px var(--edge),1590 0 0 40px 6px color-mix(in oklab, var(--accent) 16%, transparent),1591 0 0 90px 24px color-mix(in oklab, var(--accent) 7%, transparent);1592}1539159315401594.avatar-none {15411595 display: inline-grid;@@ -1543,7 +1597,7 @@ img.ficon {15431597 flex: none;15441598 color: var(--text-secondary);15451599 background: var(--surface);1546 box-shadow: 0 0 0 1px var(--borders);1600 box-shadow: 0 0 0 1px var(--rule);15471601}1548160215491603.avatar-none .icon {@@ -1571,7 +1625,7 @@ img.ficon {15711625.button:hover,15721626a.chip:hover {15731627 border-color: var(--accent-muted);1574 color: var(--accent);1628 color: var(--accent-bright);15751629}1576163015771631.button--small {@@ -1619,7 +1673,7 @@ a.chip:hover {1619167316201674.sha {16211675 padding: 0.05rem 0.4rem;1622 border: 1px solid var(--borders);1676 border: 1px solid var(--rule);16231677 border-radius: 4px;16241678 font-family: var(--mono);16251679 font-size: 0.78rem;@@ -1628,7 +1682,7 @@ a.chip:hover {16281682}1629168316301684a.sha:hover {1631 color: var(--accent);1685 color: var(--accent-bright);16321686 border-color: var(--accent-muted);16331687}16341688@@ -1651,7 +1705,7 @@ a.sha:hover {16511705}1652170616531707.copyfield input:focus-visible {1654 outline: 2px solid var(--accent);1708 outline: 2px solid var(--accent-bright);16551709 outline-offset: -1px;16561710}16571711@@ -1674,7 +1728,7 @@ a.sha:hover {16741728}1675172916761730.copy:hover {1677 color: var(--accent);1731 color: var(--accent-bright);16781732}1679173316801734.copy .icon-check,@@ -1690,9 +1744,10 @@ a.sha:hover {16901744/* boxes: the one container for listings, files, readmes and diffs */16911745.box {16921746 margin-bottom: 1.25rem;1693 border: 1px solid var(--borders);1747 border: 1px solid var(--edge);16941748 border-radius: var(--radius);16951749 background: var(--box);1750 box-shadow: var(--depth);16961751 overflow: hidden;16971752}16981753@@ -1703,8 +1758,9 @@ a.sha:hover {17031758 gap: 0.5rem 0.6rem;17041759 margin: 0;17051760 padding: 0.7rem 1rem;1706 border-bottom: 1px solid var(--borders);1707 background: var(--surface);1761 border-bottom: 1px solid var(--rule);1762 background: var(--box-head);1763 box-shadow: var(--highlight);17081764 font-family: var(--ui);17091765 font-size: 0.875rem;17101766 font-weight: 600;@@ -1739,7 +1795,7 @@ a.sha:hover {17391795}1740179617411797.rows > li + li {1742 border-top: 1px solid var(--borders);1798 border-top: 1px solid var(--rule);17431799}1744180017451801.row {@@ -1772,7 +1828,7 @@ a.sha:hover {1772182817731829a.row-title:hover,17741830.row-title a:hover {1775 color: var(--accent);1831 color: var(--accent-bright);17761832}1777183317781834.row-title a {@@ -1837,7 +1893,7 @@ a.row-title:hover,1837189318381894.profile h1 {18391895 margin: 0;1840 color: var(--accent);1896 color: var(--accent-bright);18411897 font-size: 1.9rem;18421898}18431899@@ -1917,9 +1973,10 @@ a.row-title:hover,19171973 flex-direction: column;19181974 gap: 0.4rem;19191975 padding: 1rem;1920 border: 1px solid var(--borders);1976 border: 1px solid var(--edge);19211977 border-radius: var(--radius);19221978 background: var(--box);1979 box-shadow: var(--depth);19231980 transition: border-color 150ms ease, transform 150ms ease;19241981}19251982@@ -1941,15 +1998,19 @@ a.row-title:hover,19411998}1942199919432000.repo-card:hover .repo-card-name {1944 color: var(--accent);2001 color: var(--accent-bright);19452002}1946200319472004.repo-card-desc {19482005 flex: 1;1949 color: var(--text-secondary);2006 color: var(--body-text);19502007 font-size: 0.875rem;19512008}195220092010.repo-card-desc--none {2011 color: var(--text-secondary);2012}201319532014.repo-card-meta {19542015 display: flex;19552016 flex-wrap: wrap;@@ -1998,7 +2059,7 @@ a.row-title:hover,19982059}1999206020002061.repo-title a:hover {2001 color: var(--accent);2062 color: var(--accent-bright);20022063}2003206420042065.repo-title .repo-owner {@@ -2006,7 +2067,7 @@ a.row-title:hover,20062067}2007206820082069.repo-slash {2009 color: var(--borders);2070 color: var(--rule);20102071}2011207220122073.repo-title .pill {@@ -2017,7 +2078,7 @@ a.row-title:hover,20172078.repo-desc {20182079 margin: 0.5rem 0 0;20192080 font-size: 1rem;2020 color: var(--text-body);2081 color: var(--body-text);20212082}2022208320232084.topics {@@ -2028,7 +2089,7 @@ a.row-title:hover,20282089 padding: 0.15rem 0.65rem;20292090 border-color: transparent;20302091 background: color-mix(in oklab, var(--accent-muted) 35%, transparent);2031 color: var(--accent);2092 color: var(--accent-bright);20322093 font-size: 0.75rem;20332094 letter-spacing: 0;20342095}@@ -2057,7 +2118,7 @@ a.row-title:hover,20572118}2058211920592120.repo-meta a:hover {2060 color: var(--accent);2121 color: var(--accent-bright);20612122}2062212320632124/* repo tabs */@@ -2066,7 +2127,7 @@ a.row-title:hover,20662127 gap: 0.25rem;20672128 margin: 0 0 1.25rem;20682129 overflow-x: auto;2069 border-bottom: 1px solid var(--borders);2130 border-bottom: 1px solid var(--rule);20702131 font-size: 0.9rem;20712132 scrollbar-width: none;20722133}@@ -2085,17 +2146,17 @@ a.row-title:hover,2085214620862147.tabs a:hover {20872148 color: var(--text-headings);2088 border-bottom-color: var(--borders);2149 border-bottom-color: var(--rule);20892150}2090215120912152.tabs a[aria-current="page"] {20922153 color: var(--text-headings);20932154 font-weight: 500;2094 border-bottom-color: var(--accent);2155 border-bottom-color: var(--accent-bright);20952156}2096215720972158.tabs a[aria-current="page"] .icon {2098 color: var(--accent);2159 color: var(--accent-bright);20992160}2100216121012162.count {@@ -2103,8 +2164,9 @@ a.row-title:hover,21032164 padding: 0 0.45rem;21042165 border-radius: 999px;21052166 background: var(--surface);2106 color: var(--text-secondary);2167 color: var(--text-headings);21072168 font-size: 0.75rem;2169 font-weight: 500;21082170 text-align: center;21092171}21102172@@ -2115,7 +2177,7 @@ a.row-title:hover,21152177 align-items: center;21162178 gap: 0.6rem 1.25rem;21172179 padding: 0.75rem 1rem;2118 border-bottom: 1px solid var(--borders);2180 border-bottom: 1px solid var(--rule);21192181 font-size: 0.875rem;21202182}21212183@@ -2139,7 +2201,7 @@ a.row-title:hover,2139220121402202a.stat:hover,21412203a.stat:hover b {2142 color: var(--accent);2204 color: var(--accent-bright);21432205}2144220621452207/* clone menu: a <details>, so it opens without js */@@ -2190,8 +2252,8 @@ a.stat:hover b {21902252 align-items: center;21912253 gap: 0.5rem 0.75rem;21922254 padding: 0.65rem 1rem;2193 border-bottom: 1px solid var(--borders);2194 background: var(--surface);2255 border-bottom: 1px solid var(--rule);2256 background: var(--box-head);21952257 font-size: 0.875rem;21962258}21972259@@ -2204,13 +2266,14 @@ a.stat:hover b {22042266 flex: 1 1 10rem;22052267 min-width: 0;22062268 overflow: hidden;2207 color: var(--text-secondary);2269 color: var(--text-headings);2270 font-weight: 500;22082271 white-space: nowrap;22092272 mask-image: linear-gradient(to right, black calc(100% - 3rem), transparent);22102273}2211227422122275.commit-msg:hover {2213 color: var(--accent);2276 color: var(--accent-bright);22142277}2215227822162279.box-commit time {@@ -2244,7 +2307,7 @@ a.ci:hover {22442307}2245230822462309.files tr + tr td {2247 border-top: 1px solid var(--borders);2310 border-top: 1px solid var(--rule);22482311}2249231222502313.files td {@@ -2265,10 +2328,11 @@ a.ci:hover {22652328.f-name a,22662329.f-name span {22672330 color: var(--text-headings);2331 font-weight: 500;22682332}2269233322702334.f-name a:hover {2271 color: var(--accent);2335 color: var(--accent-bright);22722336}2273233722742338/* commit messages fade out instead of ending in an ellipsis */@@ -2281,11 +2345,11 @@ a.ci:hover {2281234522822346.f-msg a,22832347.f-msg span {2284 color: var(--text-secondary);2348 color: var(--body-text);22852349}2286235022872351.f-msg a:hover {2288 color: var(--accent);2352 color: var(--accent-bright);22892353}2290235422912355.f-size,@@ -2380,7 +2444,7 @@ a.ci:hover {23802444}2381244523822446.crumbs a {2383 color: var(--accent);2447 color: var(--accent-bright);23842448}2385244923862450.crumbs a:hover {@@ -2413,8 +2477,13 @@ a.ci:hover {24132477 border-bottom: 1px solid var(--accent-muted);24142478}241524792416.markdown h1 { font-size: 1.6rem; margin: 1.5rem 0 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--borders); }2417.markdown h2 { font-size: 1.25rem; margin: 1.75rem 0 0.6rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--borders); }2480:where(p, li, td, dd, blockquote, figcaption) > a:not([class]):hover {2481 color: var(--accent-bright);2482 border-bottom-color: var(--accent-bright);2483}24842485.markdown h1 { font-size: 1.6rem; margin: 1.5rem 0 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--rule); }2486.markdown h2 { font-size: 1.25rem; margin: 1.75rem 0 0.6rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--rule); }24182487.markdown h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }2419248824202489.markdown img {@@ -2438,11 +2507,11 @@ a.ci:hover {24382507.markdown th,24392508.markdown td {24402509 padding: 0.4rem 0.75rem;2441 border: 1px solid var(--borders);2510 border: 1px solid var(--rule);24422511}2443251224442513.markdown th {2445 background: var(--surface);2514 background: var(--box-head);24462515}2447251624482517.markdown input[type="checkbox"] {@@ -2510,7 +2579,7 @@ pre.code {25102579}2511258025122581a.ln:hover {2513 color: var(--accent);2582 color: var(--accent-bright);25142583 opacity: 1;25152584}25162585@@ -2545,14 +2614,14 @@ a.ln:hover {2545261425462615.commit-body {25472616 margin: 0.75rem 0 0;2548 color: var(--text-body);2617 color: var(--body-text);25492618 font-size: 0.9rem;25502619 white-space: pre-wrap;25512620}2552262125532622.commit-meta {25542623 margin-top: 0.75rem;2555 border-top: 1px solid var(--borders);2624 border-top: 1px solid var(--rule);25562625 border-bottom: 0;25572626}25582627@@ -2568,7 +2637,7 @@ a.ln:hover {25682637.checks {25692638 margin: 0;25702639 padding: 0.25rem 0;2571 border-top: 1px solid var(--borders);2640 border-top: 1px solid var(--rule);25722641 list-style: none;25732642 font-size: 0.85rem;25742643}@@ -2667,7 +2736,7 @@ a.ln:hover {26672736.assets {26682737 margin: 0;26692738 padding: 0;2670 border-top: 1px solid var(--borders);2739 border-top: 1px solid var(--rule);26712740 list-style: none;26722741 font-size: 0.85rem;26732742}@@ -2682,7 +2751,7 @@ a.ln:hover {26822751}2683275226842753.assets li + li {2685 border-top: 1px solid var(--borders);2754 border-top: 1px solid var(--rule);26862755}2687275626882757.assets a {@@ -2693,7 +2762,7 @@ a.ln:hover {26932762}2694276326952764.assets a:hover {2696 color: var(--accent);2765 color: var(--accent-bright);26972766}2698276726992768/* pulls: each row opens its body, no js */@@ -2718,7 +2787,7 @@ a.ln:hover {27182787}2719278827202789.notfound h1 {2721 color: var(--accent);2790 color: var(--accent-bright);27222791 font-size: 4rem;27232792 margin: 0;27242793}
web/templates/profile.html
+1 −1
@@ -21,7 +21,7 @@2121 {{- range .Repos}}2222 <a class="repo-card" href="/{{.Name}}/">2323 <span class="repo-card-name">{{template "icon" "book"}}{{.Name}}</span>24 <span class="repo-card-desc">{{or .Description "No description."}}</span>24 {{if .Description}}<span class="repo-card-desc">{{.Description}}</span>{{else}}<span class="repo-card-desc repo-card-desc--none">No description.</span>{{end}}2525 <span class="repo-card-meta">2626 {{- with .Language}}<span><span class="dot {{lang .}}" aria-hidden="true"></span>{{.}}</span>{{end}}2727 <span>Updated <time class="{{fresh .UpdatedAt}}" datetime="{{.UpdatedAt.Format "2006-01-02T15:04:05Z07:00"}}">{{ago .UpdatedAt}}</time></span>