forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBorderedProminentWhiteButtonStyle.swift
More file actions
29 lines (26 loc) · 1.06 KB
/
BorderedProminentWhiteButtonStyle.swift
File metadata and controls
29 lines (26 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import SwiftUI
extension ButtonStyle where Self == BorderedProminentWhiteButtonStyle {
static var borderedProminentWhite: BorderedProminentWhiteButtonStyle {
BorderedProminentWhiteButtonStyle()
}
}
public struct BorderedProminentWhiteButtonStyle: ButtonStyle {
@Environment(\.colorScheme) var colorScheme
public func makeBody(configuration: Configuration) -> some View {
configuration.label
.padding(.leading, 4)
.padding(.trailing, 8)
.padding(.vertical, 0)
.frame(height: 22, alignment: .leading)
.foregroundColor(colorScheme == .dark ? .white : .primary)
.background(
colorScheme == .dark ? Color(red: 0.43, green: 0.43, blue: 0.44) : .white
)
.cornerRadius(5)
.overlay(
RoundedRectangle(cornerRadius: 5).stroke(.clear, lineWidth: 1)
)
.shadow(color: .black.opacity(0.05), radius: 0, x: 0, y: 0)
.shadow(color: .black.opacity(0.3), radius: 1.25, x: 0, y: 0.5)
}
}