I've tried multiple approaches:
Set inline styles but it looks like @ionic removes
style="...."attributes when generating the toastCSS variables but can't figure out how to style a nested shadow element that doesn't expose an api (ion-icon)
Currently I'm doing:
let opts = { message: '<ion-icon name="icon-name" style="font-size: 50px;...other styles..">' };
const toast = await this.toastController.create(opts);
Toasts export a named part (message) but this isn't enough since I need to make the icon bigger than the text.
ion-toast {
// this works
&::part(message) {
font-size: 1.2em;
}
// None of this works and my goal is to style the ion-icon
&::part(message) ion-icon {
font-size: 1.2em;
}
&::part(message) /deep/ ion-icon {
font-size: 1.2em;
}
&::part(message)::part(ion-icon) {
font-size: 1.2em;
}
}
Here's how my toast looks like:

Any thoughts?