Skip to content

Commit f17236f

Browse files
committed
Added sidebar button style.
1 parent c086b47 commit f17236f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import SwiftUI
2+
3+
public extension ButtonStyle where Self == SideBarActionButtonStyle {
4+
5+
static var sideBarAction: Self { SideBarActionButtonStyle() }
6+
}
7+
8+
public struct SideBarActionButtonStyle: ButtonStyle {
9+
10+
public func makeBody(configuration: Configuration) -> some View {
11+
configuration.label
12+
.foregroundColor(.accentColor)
13+
.opacity(configuration.isPressed ? 0.4 : 1)
14+
}
15+
}
16+

0 commit comments

Comments
 (0)