ionic-team / ionic-team/ionic-framework

feat: expose --button-color variable for ion-alert

Aperta
#21,500 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
package: core type: feature request
Lingua principale
TypeScript
Stelle
52.7k
Fork
13.3k
Merge medio
1g 15h
PR unite (30g)
51

Descrizione

# Feature Request
Since Ionic version 5.2.0 ion-alert buttons accept the property `role: 'destructive'`. I understand that it is possible to set the vanilla `color` css spec on the `button` element in an `ion-alert` because it is not in the shadow-dom.

**But** since Ionic 5.2.0 this solution overwrites the `ion-color-danger` on `destructive` buttons because of the css hierarchy.

It is still possible to solve it with an excluding css rule, but this seems a little bit error prone on future additional roles with different default colors (e.g. `role: 'successful'`, or something similar).

E.g. for current (not that elegant) workaround without overwriting destructive color:
```
ion-alert {
button {
&:not(.alert-button-role-destructive) {
color: var(--mobi-color-dark-blue-1000);
}
}
}
```

**Ionic version:**

[x] **5.2.0**

**Describe Preferred Solution**
Expose `--button-color` variable like in `ion-action-sheet`.

**Additional Context**
There is a closed feature request https://github.com/ionic-team/ionic/issues/21048 with a reason but I feel like the situation changed now with the role destructive on alert button since ionic version 5.2.0

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.