oficina / estilo Public

theme: touch switches are 51x31

Docs design/phone-web finding 5, slice P3. On touch (and below 40rem,
where Fiesta applies the touch tokens) a switch was the pointer size,
34x19 with a 15px knob, under the 44px a finger needs. It is now iOS's
51x31 with a 27px knob, as Fiesta's Day theme has it, in every app that
pins this.

TestTouchSwitchesAreFingerSized holds the three tokens; it failed
before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev df0b6328b6284026f29fe48ea85edb008491b2a3 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.007s
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.124s
?   	amadan.net/oficina/estilo.git/cmd/oficina-notices	[no test files]
ok  	amadan.net/oficina/estilo.git/colophon	0.023s
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.006s
ok  	amadan.net/oficina/estilo.git/googleimport	0.177s
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.018s
ok  	amadan.net/oficina/estilo.git/savestatus	0.113s
ok  	amadan.net/oficina/estilo.git/side	0.140s
ok  	amadan.net/oficina/estilo.git/sky	0.031s
ok  	amadan.net/oficina/estilo.git/theme	0.016s
ok  	amadan.net/oficina/estilo.git/typeface	0.327s
=== 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)
+ }
+ }
+}