Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🧪 test: Apply One Reference Theme Across Radius, Font, Shadow and Spacing (#16905)

Marco Beretta852e004221a6
diff --git a/packages/client/src/theme/utils/applyTheme.spec.ts b/packages/client/src/theme/utils/applyTheme.spec.ts
index 2f2d172cf1..3b13c344c3 100644
--- a/packages/client/src/theme/utils/applyTheme.spec.ts
+++ b/packages/client/src/theme/utils/applyTheme.spec.ts
@@ -176,9 +176,10 @@ describe('applyTheme', () => {
);
});
- /** The plain `rounded-*`, `font-sans` and `font-mono` utilities read these properties, so a
- * theme reaches every call site only if the adapter writes them and a reset removes them. */
- it('applies and clears the radius and shadow scales and the mono family', () => {
+ /** The plain `rounded-*`, `shadow-*`, `font-sans`, `font-mono` and control spacing utilities
+ * read these properties, so one theme reaches every call site only if the adapter writes all
+ * four families together and a reset removes them. */
+ it('applies and clears one reference theme across radius, font, shadow and spacing', () => {
const root = document.documentElement;
const scale = {
radiusSm: ['--theme-radius-sm', '0px'],
@@ -187,7 +188,14 @@ describe('applyTheme', () => {
radiusXl: ['--theme-radius-xl', '0.5rem'],
radius2xl: ['--theme-radius-2xl', '0.75rem'],
radius3xl: ['--theme-radius-3xl', '1rem'],
+ controlRadius: ['--theme-control-radius', '0.25rem'],
+ fontFamily: ['--theme-font-family', 'Inter, Arial, sans-serif'],
monoFontFamily: ['--theme-mono-font-family', 'Inconsolata, monospace'],
+ spaceCompact: ['--theme-space-compact', '0.25rem'],
+ spaceNormal: ['--theme-space-normal', '0.5rem'],
+ controlPaddingX: ['--theme-control-padding-x', '0.625rem'],
+ buttonPaddingX: ['--theme-button-padding-x', '0.875rem'],
+ controlGap: ['--theme-control-gap', '0.25rem'],
shadow2xs: ['--theme-shadow-2xs', '0 1px rgb(0 0 0 / 0.1)'],
shadowXs: ['--theme-shadow-xs', '0 1px 2px rgb(0 0 0 / 0.15)'],
shadowSm: ['--theme-shadow-sm', '0 2px 4px rgb(0 0 0 / 0.15)'],
@@ -219,6 +227,11 @@ describe('applyTheme', () => {
defaultAppearance.monoFontFamily,
);
expect(root.style.getPropertyValue('--theme-shadow-lg')).toBe(defaultAppearance.shadowLg);
+ expect(root.style.getPropertyValue('--theme-font-family')).toBe(defaultAppearance.fontFamily);
+ expect(root.style.getPropertyValue('--theme-space-normal')).toBe(defaultAppearance.spaceNormal);
+ expect(root.style.getPropertyValue('--theme-control-padding-x')).toBe(
+ defaultAppearance.controlPaddingX,
+ );
clearAppliedTheme(root);
Object.values(scale).forEach(([property]) => {