Skip to content

Commit

Permalink
Fix a colour token in light mode on the SendButton. (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave authored Dec 6, 2024
1 parent 78e1290 commit 7ebf9db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Sources/Compound/Buttons/SendButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ public struct SendButton: View {
/// The action to perform when the user triggers the button.
public let action: () -> Void

private var iconColor: Color { isEnabled ? .compound.iconPrimary : .compound.iconQuaternary }
private var iconColor: Color {
guard isEnabled else { return .compound.iconQuaternary }
return colorScheme == .light ? .compound.iconOnSolidPrimary : .compound.iconPrimary
}

private var gradient: Gradient { isEnabled ? enabledGradient : .init(colors: [.clear]) }
private var colorSchemeOverride: ColorScheme { isEnabled ? .dark : colorScheme }

/// This is a custom gradient used for this button, the colours don't come from our core tokens
/// and aren't reactive to light/dark mode or high contrast, so it is hard coded in here.
Expand All @@ -39,7 +42,6 @@ public struct SendButton: View {
.foregroundStyle(iconColor)
.scaledPadding(6, relativeTo: .compound.headingLG)
.background { buttonShape }
.environment(\.colorScheme, colorSchemeOverride)
.compositingGroup()
}
}
Expand Down

0 comments on commit 7ebf9db

Please sign in to comment.