ionic-team / ionic-team/ionic-framework

bug: --button-color does not modify cancel button color in toasts

Ouverte
#21,818 2 commentaires 5 réactions 0 personnes assignées Voir sur GitHub
package: core type: bug
Langage dominant
TypeScript
Étoiles
52.7k
Forks
13.3k
Merge moyen
1 j 15 h
PR mergées (30 j)
51

Description

# Bug Report

**Ionic version:**

[ ] **4.x**
[x] **5.x**

**Current behavior:**

Toast [custom css property](https://ionicframework.com/docs/api/toast#css-custom-properties) `--button-color` does not affect cancel button.

**Expected behavior:**

Affecting a color through `--button-color` should modify the color of all buttons present in the toast

**Steps to reproduce:**

1. start a template
2. add a toast
3. add a `--button-color` property in app.scss

**Related code:**

app.component.ts

```ts
const toast = await this.toastCtrl.create({
header: 'Toast header',
message: 'Click to Close',
position: 'top',
buttons: [
{
side: 'start',
icon: 'star',
text: 'Favorite',
handler: () => {
console.log('Favorite clicked');
}
}, {
text: 'Done',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
toast.present();
```

app.scss

```scss
ion-toast {
--background: red;
--button-color: red;
}
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start by reproducing the toast from app.component.ts with the --button-color rule in app.scss. Read the toast CSS custom-properties documentation and inspect the toast implementation to trace how button roles receive their color. Done means --button-color changes the color of every button, including the role="cancel" button.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
scss, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.