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): stop button text scaling below the lg size

joshistoastaf9ca9803921
diff --git a/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts b/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts
index dda370c9f0..66b1df0204 100644
--- a/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts
+++ b/invokeai/frontend/webv2/src/platform/ui/theme/recipes.ts
@@ -121,6 +121,24 @@ export const tabsSlotRecipe = defineSlotRecipe({
} as typeof chakraSlotRecipes.tabs.variants,
});
+/**
+ * Buttons: the text size stops scaling below `lg`. The workbench is dense, and
+ * a 14px label on a 40px `md` button reads as a marketing button next to the
+ * 12px chrome around it. `sm` moves with `md` — otherwise the smaller button
+ * would carry the larger label.
+ */
+export const buttonRecipe = defineRecipe({
+ ...chakraRecipes.button,
+ variants: {
+ ...chakraRecipes.button.variants,
+ size: {
+ ...chakraRecipes.button.variants?.size,
+ sm: { ...chakraRecipes.button.variants?.size?.sm, textStyle: 'xs' },
+ md: { ...chakraRecipes.button.variants?.size?.md, textStyle: 'xs' },
+ },
+ } as unknown as typeof chakraRecipes.button.variants,
+});
+
/**
* Segment control: a flat strip, not a recessed pill.
*
diff --git a/invokeai/frontend/webv2/src/platform/ui/theme/system.ts b/invokeai/frontend/webv2/src/platform/ui/theme/system.ts
index e602987a57..86c4f8963d 100644
--- a/invokeai/frontend/webv2/src/platform/ui/theme/system.ts
+++ b/invokeai/frontend/webv2/src/platform/ui/theme/system.ts
@@ -1,6 +1,7 @@
import { createSystem, defaultConfig, defineConfig } from '@chakra-ui/react';
import {
+ buttonRecipe,
colorPickerSlotRecipe,
comboboxSlotRecipe,
dialogSlotRecipe,
@@ -279,6 +280,7 @@ const config = defineConfig({
// Chrome-level overrides for Chakra's built-in components, so popover and
// dialog surfaces are consistent everywhere without per-instance props.
recipes: {
+ button: buttonRecipe,
input: inputRecipe,
textarea: textareaRecipe,
},