SwiftUI .destructive alert button in macOS dark mode — poor contrast

Here is a simple view to demonstrate the issue

struct ContentView: View {
    @State private var isPresented = false
    var body: some View {
        VStack {
            Button("Test") { isPresented = true }
        }
        .alert("Test", isPresented: $isPresented, actions: {
            Button("Delete All", role: .destructive) {}
        }, message: {
            Text("Are You Sure?")
        })
        .padding()
    }
}```

Which results in

![example alert]("https://developer.apple.com/forums/content/attachment/c6210120-d82e-4df5-a01a-fc5cb168e1bf" "title=Screenshot 2025-09-08 at 08.57.21.png;width=546;height=442")

The destructive button is almost unreadable. WCAG score is 1.4, far below the minimum recommended 4.5.

I found [this post](https://stackoverflow.com/q/66448869) on SO going back to Big Sur, but not on this forum.

Any known workarounds (except for building my own dialogs, which I am trying to avoid)?

Using confirmationDialog instead of alert does not make a difference.

Your post isn't formatted correctly, and we can't actually see your screenshot.

Would you mind replying to this thread, with better formatting?

In the meantime, if you think this is serious enough to be a bug, raise it in the Feedback Assistant: https://feedbackassistant.apple.com/ then post the FB number here.

Here is a simple view to demonstrate the issue

struct ContentView: View {
    @State private var isPresented = false
    var body: some View {
        VStack {
            Button("Test") { isPresented = true }
        }
        .alert("Test", isPresented: $isPresented, actions: {
            Button("Delete All", role: .destructive) {}
        }, message: {
            Text("Are You Sure?")
        })
        .padding()
    }
}

Which results in

The destructive button is almost unreadable. WCAG score is 1.4, far below the minimum recommended 4.5.

I found this post on SO going back to Big Sur, but not on this forum.

Any known workarounds (except for building my own dialogs, which I am trying to avoid)?

Using confirmationDialog instead of alert does not make a difference.

You're right, it is hardly readable on Mac in dark mode (OK on iOS).

Could this provide a work around ? https://www.theswift.dev/posts/swiftui-alert-with-styled-buttons

But may be worth a bug report.

That post advises to use .destructive (which is clearly not working) and provides an (iOS-only?) option to change the color of all non-destructive buttons, and I don't want to turn all my buttons red 😎

I'll file a FB report.

FB20158292

Just tried the same experiment in a (newly created) AppKit app, exact same readability issue, so it's not SwiftUI-specific.

Hmm, looks like I cannot edit the title of this post, or add an "appkit" tag.

SwiftUI .destructive alert button in macOS dark mode — poor contrast
 
 
Q