2dee0541a282

polish: add named PeachType scale (spec §2.2); replace static accent constants with runtime accent derivations; flash follows live accent (v2.1.14)

time
2026-06-08 18:37 UTC · 5 months ago
machine
koh2
agent
claude-opus-4-8
session
vault visual parity v2
parent
09c65844fada
4 files app/src/main/java/com/peachpasswords/ui/theme/AccentColors.kt+7 −0app/src/main/java/com/peachpasswords/ui/theme/PeachColors.kt+4 −4app/src/main/java/com/peachpasswords/ui/theme/PeachType.kt+80 −0app/src/main/java/com/peachpasswords/ui/vault/VaultListScreen.kt+2 −1
app/src/main/java/com/peachpasswords/ui/theme/AccentColors.kt+7 −0
@@ -18,3 +18,10 @@1818 )1919 2020 val DEFAULT_ACCENT = ACCENT_COLORS.getValue("peach")21+22+// Accent-derived tokens (spec §1.2), computed from the *current* accent at the23+// call site so they re-derive whenever the user changes their accent colour.24+fun Color.peachGlow(): Color = copy(alpha = 0.16f)25+fun Color.peachSurfaceTint(): Color = copy(alpha = 0.035f)26+fun Color.peachBorderAccent(): Color = copy(alpha = 0.141f)27+fun Color.peachAccentDim(): Color = copy(alpha = 0.25f)

view file

app/src/main/java/com/peachpasswords/ui/theme/PeachColors.kt+4 −4
@@ -17,11 +17,11 @@1717     val T3 = Color(0x12F0E8D8)1818     val T4 = Color(0x0AF0E8D8)1919 20+    // CSS `--ac` fallback before applyAccent() runs (spec §1.1). The live21+    // runtime accent is DEFAULT_ACCENT / LocalPeachAccent; all accent-derived22+    // tints are computed from the current accent (see AccentColors.kt), never23+    // from a frozen constant, so they follow the user's chosen colour.2024     val Accent = Color(0xFFE8956D)21-    val AccentDim = Color(0x40E8956D)22-    val AccentGlow = Color(0x2AF49C70)23-    val AccentSurfaceTint = Color(0x09F49C70)24-    val AccentBorder = Color(0x24F49C70)2525 2626     val Breach = Color(0xB3DC503C)2727     val BreachBg = Color(0x12DC503C)

view file

app/src/main/java/com/peachpasswords/ui/theme/PeachType.kt+80 −0
@@ -1,9 +1,12 @@11 package com.peachpasswords.ui.theme22 3+import androidx.compose.ui.text.TextStyle34 import androidx.compose.ui.text.font.Font45 import androidx.compose.ui.text.font.FontFamily56 import androidx.compose.ui.text.font.FontStyle67 import androidx.compose.ui.text.font.FontWeight8+import androidx.compose.ui.unit.em9+import androidx.compose.ui.unit.sp710 import com.peachpasswords.R811 912 object PeachType {@@ -26,4 +29,81 @@2629     )2730 2831     val Script = FontFamily(Font(R.font.peachscript_regular, FontWeight.Normal))32+33+    // ── Named type scale (spec §2.2) ────────────────────────────────────────34+    // Sizes, styles, line-heights and letter-spacing transcribed from the35+    // browser type scale so every screen reads from one shared vocabulary36+    // instead of redefining inline styles. Opacity/colour are applied at the37+    // call site, not baked in here.38+39+    val entryNameList = TextStyle(40+        fontFamily = Display, fontSize = 13.sp, fontStyle = FontStyle.Italic,41+        lineHeight = (13 * 1.25).sp,42+    )43+    val entryNameHero = TextStyle(44+        fontFamily = Display, fontSize = 44.sp, fontStyle = FontStyle.Italic,45+        lineHeight = (44 * 0.95).sp,46+    )47+    val lockHeadline = TextStyle(48+        fontFamily = Display, fontSize = 44.sp, fontStyle = FontStyle.Italic,49+        lineHeight = (44 * 0.95).sp,50+    )51+    val createHeadline = TextStyle(52+        fontFamily = Display, fontSize = 24.sp, fontStyle = FontStyle.Italic,53+        lineHeight = (24 * 1.05).sp,54+    )55+    val onboardingHeadline = TextStyle(56+        fontFamily = Display, fontSize = 22.sp, fontStyle = FontStyle.Italic,57+        lineHeight = (22 * 1.05).sp,58+    )59+    val settingsActive = TextStyle(60+        fontFamily = Display, fontSize = 26.sp, fontStyle = FontStyle.Italic,61+    )62+    val settingsTab = TextStyle(63+        fontFamily = Display, fontSize = 19.sp, fontStyle = FontStyle.Italic,64+    )65+    val settingsLede = TextStyle(66+        fontFamily = Display, fontSize = 12.5.sp, fontStyle = FontStyle.Italic,67+    )68+    val syncHeadline = TextStyle(69+        fontFamily = Display, fontSize = 28.sp, fontStyle = FontStyle.Italic,70+        fontWeight = FontWeight.SemiBold, lineHeight = (28 * 1.2).sp,71+    )72+    val searchInput = TextStyle(73+        fontFamily = Display, fontSize = 18.sp, fontStyle = FontStyle.Italic,74+    )75+    val unlockInput = TextStyle(76+        fontFamily = Display, fontSize = 22.sp, fontStyle = FontStyle.Italic,77+        letterSpacing = 0.18.em,78+    )79+    val totpCode = TextStyle(80+        fontFamily = Display, fontSize = 38.sp, fontStyle = FontStyle.Italic,81+    )82+    val totpCountdown = TextStyle(83+        fontFamily = Mono, fontSize = 22.sp, letterSpacing = 0.04.em,84+    )85+    val chirpCode = TextStyle(86+        fontFamily = Mono, fontSize = 36.sp, letterSpacing = 0.25.em,87+    )88+    val sortPill = TextStyle(89+        fontFamily = Mono, fontSize = 9.sp, letterSpacing = 0.08.em,90+    )91+    val lockEyebrow = TextStyle(92+        fontFamily = Mono, fontSize = 9.sp, letterSpacing = 0.1.em,93+    )94+    val recoveryNumeral = TextStyle(95+        fontFamily = Display, fontSize = 12.sp, fontStyle = FontStyle.Italic,96+        letterSpacing = 0.02.em,97+    )98+    val recoveryWord = TextStyle(99+        fontFamily = Mono, fontSize = 11.sp, letterSpacing = 0.06.em,100+    )101+    val wordmark = TextStyle(102+        fontFamily = Display, fontSize = 15.sp, fontStyle = FontStyle.Italic,103+    )104+    val bodyMono = TextStyle(fontFamily = Mono, fontSize = 13.sp)105+    val labelMono = TextStyle(fontFamily = Mono, fontSize = 10.sp, letterSpacing = 0.04.em)106+    val tinyMono = TextStyle(fontFamily = Mono, fontSize = 8.sp, letterSpacing = 0.04.em)107+    val body = TextStyle(fontFamily = Body, fontSize = 13.sp)108+    val hint = TextStyle(fontFamily = Body, fontSize = 12.sp)29109 }

view file

app/src/main/java/com/peachpasswords/ui/vault/VaultListScreen.kt+2 −1
@@ -232,8 +232,9 @@232232     onSwipeCopy: () -> Unit,233233 ) {234234     val context = LocalContext.current235+    val accent = LocalPeachAccent.current235236     val rowBg by animateColorAsState(236-        targetValue = if (flashing) PeachColors.AccentGlow else Color.Transparent,237+        targetValue = if (flashing) accent.copy(alpha = 0.32f) else Color.Transparent,237238         label = "row-flash",238239     )239240     val meta = remember(entry) { entry.domainKeyOrUser() }

view file