Improves helder

This commit is contained in:
2026-10-05 09:24:25 +02:00
parent 8fafea4fc3
commit 336987d821
44 changed files with 3454 additions and 542 deletions
+2 -12
View File
@@ -5,10 +5,6 @@ public struct Keycap: View {
public enum Style {
/// Amber glyph, raised border.
case normal
/// On an active toolbar toggle: the border turns amber.
case active
/// On a toggle that is off by meaning: glyph and border step back to text-4.
case muted
/// On an amber fill (primary button): ink glyph, ink border.
case onAmber
/// On an amber-deep fill (destructive button): light glyph, light border.
@@ -25,10 +21,6 @@ public struct Keycap: View {
role = small ? Typography.keycapSmall : Typography.keycap
}
public init(_ keys: String, highlighted: Bool) {
self.init(keys, style: highlighted ? .active : .normal)
}
public var body: some View {
Text(keys)
.typeRole(role)
@@ -41,8 +33,7 @@ public struct Keycap: View {
private var glyph: Color {
switch style {
case .normal, .active: Palette.amber
case .muted: Palette.text4
case .normal: Palette.amber
case .onAmber: Palette.ink
case .onDeep: Palette.onDeep
}
@@ -50,8 +41,7 @@ public struct Keycap: View {
private var border: Color {
switch style {
case .normal, .muted: Palette.raised
case .active: Palette.amberKeycapBorder
case .normal: Palette.raised
case .onAmber: Palette.inkKeycapBorder
case .onDeep: Palette.onDeep.opacity(0.4)
}