ionic-team / ionic-team/ionic-framework

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

オープン
#21,500 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
package: core type: feature request
主要言語
TypeScript
スター
52.7k
フォーク
13.3k
平均マージ
1日 15時間
マージ済み PR(30日)
51

説明

# 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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。