Paint a destructive Dialog button with Nextcloud's error text color.

The theme's error background is a pale pink, so a white label looked disabled.
This commit is contained in:
2026-09-29 02:53:59 +02:00
parent 0a387815a0
commit 4e05fb1c6a
2 changed files with 12 additions and 5 deletions
+5 -5
View File
@@ -67,16 +67,16 @@ const dialogStyle = `<style>
font: inherit;
cursor: pointer;
}
#exapp-dialog-agree {
#exapp-dialog-actions button#exapp-dialog-agree {
border-color: transparent;
background: var(--color-primary-element, #00679e);
color: var(--color-primary-element-text, #fff);
}
#exapp-dialog-agree.destructive {
background: var(--color-error, #e9322d);
color: #fff;
#exapp-dialog-actions button#exapp-dialog-agree.destructive {
background: var(--color-error, #ffe7e7);
color: var(--color-error-text, #8a0000);
}
#exapp-dialog-agree:disabled { opacity: 0.45; cursor: default; }
#exapp-dialog-actions button#exapp-dialog-agree:disabled { opacity: 0.45; cursor: default; }
</style>`
const dialogMarkup = `<dialog id="exapp-dialog" aria-modal="true">
+7
View File
@@ -350,6 +350,13 @@ func TestConfirmYesNoAndDestructive(t *testing.T) {
if plain == destructive {
return fmt.Errorf("destructive button color %q matches Cancel", destructive)
}
var text string
if err := chromedp.Evaluate(`getComputedStyle(document.getElementById("exapp-dialog-agree")).color`, &text).Do(ctx); err != nil {
return err
}
if text == "rgb(255, 255, 255)" || text == destructive {
return fmt.Errorf("destructive label color %q on background %q", text, destructive)
}
var label string
if err := chromedp.Evaluate(`document.getElementById("exapp-dialog-agree").textContent`, &label).Do(ctx); err != nil {
return err