Something went wrong. Try again.
A native macOS client for Tangled.
Something went wrong. Try again.
674 B · 26 lines
Swift
at main
123456789101112131415161718192021222324252627import SwiftUI
struct TangledGlassButtonModifier: ViewModifier { let prominent: Bool
@ViewBuilder func body(content: Content) -> some View { if #available(macOS 26.0, *) { if prominent { content.buttonStyle(.glassProminent) } else { content.buttonStyle(.glass) } } else if prominent { content.buttonStyle(.borderedProminent) } else { content.buttonStyle(.bordered) } }}
extension View { func tangledGlassButton(prominent: Bool = false) -> some View { modifier(TangledGlassButtonModifier(prominent: prominent)) }}