Skip to content

Commit 811e2a5

Browse files
committed
fix(toast): default to neutral colors
1 parent d184ad0 commit 811e2a5

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

core/src/components/toast/test/hue/index.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@
6464
const color = toast.color || 'default';
6565
toast.message = `This is a ${hue} ${color} toast.`;
6666

67-
toast.buttons = [{
68-
text: 'Action',
69-
role: 'cancel'
70-
}];
67+
toast.buttons = [
68+
{
69+
text: 'Action',
70+
role: 'cancel',
71+
},
72+
];
7173

7274
// Set dynamic position for each toast to ensure they don't overlap
7375
toast.style.position = 'absolute';
@@ -81,22 +83,22 @@
8183
toastOffset += 60;
8284
});
8385

84-
document.getElementById("backdrop").style.display = "block";
86+
document.getElementById('backdrop').style.display = 'block';
8587
}
8688

8789
// Dismiss all toasts when backdrop is clicked
8890
function dismissAllToasts() {
8991
const toasts = document.querySelectorAll('ion-toast');
90-
toasts.forEach(toast => toast.dismiss());
92+
toasts.forEach((toast) => toast.dismiss());
9193

92-
document.getElementById("backdrop").style.display = "none";
94+
document.getElementById('backdrop').style.display = 'none';
9395
}
9496

95-
document.addEventListener("DOMContentLoaded", function () {
96-
document.getElementById("show-subtle-toasts").addEventListener("click", () => openAllToasts(false));
97-
document.getElementById("show-bold-toasts").addEventListener("click", () => openAllToasts(true));
97+
document.addEventListener('DOMContentLoaded', function () {
98+
document.getElementById('show-subtle-toasts').addEventListener('click', () => openAllToasts(false));
99+
document.getElementById('show-bold-toasts').addEventListener('click', () => openAllToasts(true));
98100

99-
document.getElementById("backdrop").addEventListener("click", dismissAllToasts);
101+
document.getElementById('backdrop').addEventListener('click', dismissAllToasts);
100102
});
101103
</script>
102104

core/src/components/toast/toast.ionic.scss

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,26 +134,25 @@
134134
// --------------------------------------------------
135135

136136
:host(.toast-hue-bold) {
137-
--background: #{globals.ion-color(secondary, base)};
138-
--background-activated: #{globals.ion-color(secondary, shade)};
139-
--color: #{globals.ion-color(secondary, contrast)};
140-
--button-color: #{globals.ion-color(secondary, contrast)};
137+
--background: #{globals.$ion-bg-neutral-boldest-default};
138+
--background-activated: #{globals.$ion-bg-neutral-boldest-press};
139+
--color: #{globals.$ion-text-inverse};
140+
--button-color: #{globals.$ion-text-inverse};
141141
}
142142

143143
:host(.toast-hue-bold.ion-color) .toast-wrapper {
144144
background: globals.current-color(base);
145145
color: globals.current-color(contrast);
146146
}
147147

148-
149148
// Subtle Toast
150149
// --------------------------------------------------
151150

152151
:host(.toast-hue-subtle) {
153-
--background: #{globals.ion-color(secondary, base, $subtle: true)};
154-
--background-activated: #{globals.ion-color(secondary, shade, $subtle: true)};
155-
--color: #{globals.ion-color(secondary, contrast, $subtle: true)};
156-
--button-color: #{globals.ion-color(secondary, contrast, $subtle: true)};
152+
--background: #{globals.$ion-bg-neutral-subtlest-default};
153+
--background-activated: #{globals.$ion-bg-neutral-subtlest-press};
154+
--color: #{globals.$ion-text-default};
155+
--button-color: #{globals.$ion-text-link-default};
157156
}
158157

159158
:host(.toast-hue-subtle.ion-color) .toast-wrapper {

0 commit comments

Comments
 (0)