oficina / estilo Public

theme: 51×31 touch switch with a 27 px knob (#44)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from feat/touch-switch into main.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev c43430ed65d572b11088112c657a389f871f1fa9 parent 2b2beb5
2 files changed, +23 −3
  • theme/estilo.css +7 −3
  • theme/theme_test.go +16 −0

CI passed — run details

CI log
=== modcache ===
all modules verified
=== vet ===
CGO_ENABLED=0 go vet ./...
CGO_ENABLED=0 go vet -tags browser ./...
=== fmt ===
=== build ===
CGO_ENABLED=0 go build -buildvcs=false ./...
=== go-test ===
CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/estilo.git/base	0.004s
ok  	amadan.net/oficina/estilo.git/brand	0.003s
ok  	amadan.net/oficina/estilo.git/busy	0.009s
ok  	amadan.net/oficina/estilo.git/callui	0.004s
ok  	amadan.net/oficina/estilo.git/chrome	1.077s
?   	amadan.net/oficina/estilo.git/cmd/oficina-notices	[no test files]
ok  	amadan.net/oficina/estilo.git/colophon	0.022s
ok  	amadan.net/oficina/estilo.git/credits	0.005s
ok  	amadan.net/oficina/estilo.git/credits/catalog	0.004s
ok  	amadan.net/oficina/estilo.git/desk	0.004s
ok  	amadan.net/oficina/estilo.git/googleimport	0.174s
ok  	amadan.net/oficina/estilo.git/homeconnect	0.005s
ok  	amadan.net/oficina/estilo.git/internal/lint	0.007s
?   	amadan.net/oficina/estilo.git/internal/tokencheck	[no test files]
ok  	amadan.net/oficina/estilo.git/menu	0.011s
ok  	amadan.net/oficina/estilo.git/savestatus	0.118s
ok  	amadan.net/oficina/estilo.git/side	0.161s
ok  	amadan.net/oficina/estilo.git/sky	0.037s
ok  	amadan.net/oficina/estilo.git/theme	0.014s
ok  	amadan.net/oficina/estilo.git/typeface	0.330s
=== spacing ===
go run amadan.net/rastrillo/fiesta/cmd/fiesta@v1.7.0 spacing .
diff --git a/theme/estilo.css b/theme/estilo.css
index 6a086a8..bffd047 100644
--- a/theme/estilo.css
+++ b/theme/estilo.css
@@ -170,9 +170,13 @@
--rst-switch-w: 34px;
--rst-switch-h: 19px;
--rst-switch-knob: 15px;
- --rst-switch-touch-w: 34px;
- --rst-switch-touch-h: 19px;
- --rst-switch-touch-knob: 15px;
+ /* On touch (and below 40rem, where Fiesta applies these) the switch
+ is the size a finger expects, iOS's 51x31 with a 27px knob, as
+ Fiesta's Day theme has it: it was the pointer size, 34x19 (phone
+ web finding 5, Docs design/phone-web P3). */
+ --rst-switch-touch-w: 51px;
+ --rst-switch-touch-h: 31px;
+ --rst-switch-touch-knob: 27px;
/* Type and navigation. */
--rst-title-size: 1.375rem;
diff --git a/theme/theme_test.go b/theme/theme_test.go
index 1a2ed3c..e8b4581 100644
--- a/theme/theme_test.go
+++ b/theme/theme_test.go
@@ -278,3 +278,19 @@ func TestTheRingIsClosed(t *testing.T) {
seen[a.Slug] = true
}
}
+
+// On touch a switch is the size a finger expects: iOS's 51x31 with a
+// 27px knob, as Fiesta's Day theme has it. It was the pointer size,
+// 34x19 (Docs design/phone-web, finding 5; slice P3).
+func TestTouchSwitchesAreFingerSized(t *testing.T) {
+ got := parseTokens(string(css))
+ for name, want := range map[string]string{
+ "--rst-switch-touch-w": "51px",
+ "--rst-switch-touch-h": "31px",
+ "--rst-switch-touch-knob": "27px",
+ } {
+ if got[name] != want {
+ t.Errorf("estilo.css %s = %q, want %q", name, got[name], want)
+ }
+ }
+}