Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/Shared/Support/ApproachNoteButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private struct ApproachNoteButtonStyle: ButtonStyle {
.font(ApproachNoteTheme.headline())
.foregroundColor(appearance.foreground)
.frame(maxWidth: .infinity)
.padding(.vertical, 14)
.padding(.vertical, ApproachNoteTheme.controlVerticalPadding)
.padding(.horizontal, ApproachNoteTheme.spacingXL)
.background(
RoundedRectangle(cornerRadius: 10, style: .continuous)
Expand Down
11 changes: 11 additions & 0 deletions apps/Shared/Support/ApproachNoteTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,17 @@ extension ApproachNoteTheme {
static let spacingXL: CGFloat = 24
}

// Component metrics that intentionally sit *outside* the spacing scale above.
// These are not inter-element spacing — they size the interior of a specific
// control to hit a comfortable tap target, and are deliberately named so the
// off-scale value reads as intentional rather than a stray literal.
extension ApproachNoteTheme {
/// Vertical padding inside the filled/outlined pill control
/// (`ApproachNoteButton`). Tuned for tap-target height, not section rhythm,
/// so it sits between `spacingSM` (12) and `spacingMD` (16).
static let controlVerticalPadding: CGFloat = 14
}

// MARK: - Semantic Color Tokens
//
// Colors are organized by *role*, not pigment. Pick the token that matches
Expand Down
2 changes: 1 addition & 1 deletion apps/iOS/Support/ToastView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct ToastView: View {
.buttonStyle(.plain)
}
.padding(.horizontal, ApproachNoteTheme.spacingMD)
.padding(.vertical, 14)
.padding(.vertical, ApproachNoteTheme.spacingMD)
.background(
RoundedRectangle(cornerRadius: 12)
.fill(.white)
Expand Down
15 changes: 15 additions & 0 deletions doc/design/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,18 @@ extension ApproachNoteTheme {
Reference these tokens in views instead of literals — `SongDetailView` is the
adopted template. Treat any spacing value outside this set as a smell. Issue
#199 tracks rolling adoption through the remaining screens.

### Component metrics (intentionally off-scale)

A few values size the *interior of a specific control* rather than the rhythm
between elements, so they live outside the spacing scale by design. They get
named tokens so the off-scale number reads as intentional, not a stray literal:

```swift
static let controlVerticalPadding: CGFloat = 14 // ApproachNoteButton pill, tap-target height
```

`ApproachNoteButton` uses `controlVerticalPadding` (14) — kept off-scale to hold
its tap-target height; snapping to `sm`/`md` would shift the pill's proportions.
`ToastView`, by contrast, was snapped to `spacingMD` (16): its padding is card
breathing room, not a tap target, so it belongs on the scale. (Per #202.)
Loading