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:
@@ -67,16 +67,16 @@ const dialogStyle = `<style>
|
|||||||
font: inherit;
|
font: inherit;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
#exapp-dialog-agree {
|
#exapp-dialog-actions button#exapp-dialog-agree {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
background: var(--color-primary-element, #00679e);
|
background: var(--color-primary-element, #00679e);
|
||||||
color: var(--color-primary-element-text, #fff);
|
color: var(--color-primary-element-text, #fff);
|
||||||
}
|
}
|
||||||
#exapp-dialog-agree.destructive {
|
#exapp-dialog-actions button#exapp-dialog-agree.destructive {
|
||||||
background: var(--color-error, #e9322d);
|
background: var(--color-error, #ffe7e7);
|
||||||
color: #fff;
|
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>`
|
</style>`
|
||||||
|
|
||||||
const dialogMarkup = `<dialog id="exapp-dialog" aria-modal="true">
|
const dialogMarkup = `<dialog id="exapp-dialog" aria-modal="true">
|
||||||
|
|||||||
@@ -350,6 +350,13 @@ func TestConfirmYesNoAndDestructive(t *testing.T) {
|
|||||||
if plain == destructive {
|
if plain == destructive {
|
||||||
return fmt.Errorf("destructive button color %q matches Cancel", 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
|
var label string
|
||||||
if err := chromedp.Evaluate(`document.getElementById("exapp-dialog-agree").textContent`, &label).Do(ctx); err != nil {
|
if err := chromedp.Evaluate(`document.getElementById("exapp-dialog-agree").textContent`, &label).Do(ctx); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user