Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(webv2): darken success and warning toast fills for AA contrast

Lincoln Steind74a87b00b6c
diff --git a/invokeai/frontend/webv2/src/platform/ui/theme/ToastContrast.browser.test.tsx b/invokeai/frontend/webv2/src/platform/ui/theme/ToastContrast.browser.test.tsx
index 6d06b595cb..432b652247 100644
--- a/invokeai/frontend/webv2/src/platform/ui/theme/ToastContrast.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/platform/ui/theme/ToastContrast.browser.test.tsx
@@ -20,8 +20,7 @@ afterEach(async () => {
});
describe('toast contrast', () => {
- // Success and warning fills (green/orange 600) stay below AA even for full-strength white text.
- it.each(['error', 'info'] as const)('renders a %s description at AA contrast', async (type) => {
+ it.each(['error', 'info', 'success', 'warning'] as const)('renders a %s description at AA contrast', async (type) => {
host = document.createElement('div');
document.body.append(host);
root = createRoot(host);
diff --git a/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts b/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts
index 997d7845e5..32fe51c41e 100644
--- a/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts
+++ b/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts
@@ -69,11 +69,19 @@ export const popoverSlotRecipe = defineSlotRecipe({
},
});
-/** Chakra dims descriptions to 80%, which drops them below AA on the solid status fills. */
+/**
+ * Keep white status text at AA: Chakra dims descriptions to 80%, and its green/orange 600 fills are too light
+ * for white at any opacity, so success and warning use the 700 step.
+ */
export const toastSlotRecipe = defineSlotRecipe({
...chakraSlotRecipes.toast,
base: {
...chakraSlotRecipes.toast.base,
+ root: {
+ ...chakraSlotRecipes.toast.base?.root,
+ '&[data-type=success]': { ...chakraSlotRecipes.toast.base?.root?.['&[data-type=success]'], bg: 'green.700' },
+ '&[data-type=warning]': { ...chakraSlotRecipes.toast.base?.root?.['&[data-type=warning]'], bg: 'orange.700' },
+ },
description: { ...chakraSlotRecipes.toast.base?.description, opacity: 1 },
},
});