Skip to content

Commit 08a1193

Browse files
authored
fix: commented out light mode (#2173)
1 parent 3158b62 commit 08a1193

File tree

6 files changed

+27
-26
lines changed

6 files changed

+27
-26
lines changed

apps/sim/app/_shell/providers/theme-provider.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import { ThemeProvider as NextThemesProvider } from 'next-themes'
77
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
88
const pathname = usePathname()
99

10-
// Force light mode for public/marketing pages
11-
// Workspace and templates respect user's theme preference from settings
12-
const forcedTheme =
10+
// Force light mode on public/marketing pages, dark mode everywhere else
11+
const isLightModePage =
1312
pathname === '/' ||
1413
pathname.startsWith('/login') ||
1514
pathname.startsWith('/signup') ||
@@ -22,17 +21,15 @@ export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
2221
pathname.startsWith('/changelog') ||
2322
pathname.startsWith('/chat') ||
2423
pathname.startsWith('/studio')
25-
? 'light'
26-
: undefined
2724

2825
return (
2926
<NextThemesProvider
3027
attribute='class'
31-
defaultTheme='system'
32-
enableSystem
28+
defaultTheme='dark'
29+
enableSystem={false}
3330
disableTransitionOnChange
3431
storageKey='sim-theme'
35-
forcedTheme={forcedTheme}
32+
forcedTheme={isLightModePage ? 'light' : 'dark'}
3633
{...props}
3734
>
3835
{children}

apps/sim/app/_styles/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
:root,
8282
.light {
8383
/* Neutrals (surfaces) - shadcn stone palette */
84-
--bg: #fafaf9; /* stone-50 */
84+
--bg: #ffffff; /* pure white for landing/auth pages */
8585
--surface-1: #fafaf9; /* stone-50 */
8686
--surface-2: #ffffff; /* white */
8787
--surface-3: #f5f5f4; /* stone-100 */

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components-new/settings-modal/components/general/general.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from 'react'
44
import { Camera, Check, Pencil } from 'lucide-react'
55
import Image from 'next/image'
66
import { useRouter } from 'next/navigation'
7-
import { Button, Combobox, Label, Switch } from '@/components/emcn'
7+
import { Button, Label, Switch } from '@/components/emcn'
88
import {
99
Modal,
1010
ModalBody,
@@ -372,7 +372,7 @@ export function General({ onOpenChange }: GeneralProps) {
372372
</div>
373373
{uploadError && <p className='text-[13px] text-[var(--text-error)]'>{uploadError}</p>}
374374

375-
<div className='flex items-center justify-between border-b pb-[12px]'>
375+
{/* <div className='flex items-center justify-between border-b pb-[12px]'>
376376
<Label htmlFor='theme-select'>Theme</Label>
377377
<div className='w-[100px]'>
378378
<Combobox
@@ -390,9 +390,9 @@ export function General({ onOpenChange }: GeneralProps) {
390390
]}
391391
/>
392392
</div>
393-
</div>
393+
</div> */}
394394

395-
<div className='flex items-center justify-between'>
395+
<div className='flex items-center justify-between pt-[12px]'>
396396
<Label htmlFor='auto-connect'>Auto-connect on drop</Label>
397397
<Switch
398398
id='auto-connect'
@@ -514,11 +514,11 @@ function GeneralSkeleton() {
514514
</div>
515515
</div>
516516

517-
{/* Theme row */}
518-
<div className='flex items-center justify-between border-b pb-[12px]'>
517+
{/* Theme row - temporarily hidden while light mode is disabled */}
518+
{/* <div className='flex items-center justify-between border-b pb-[12px]'>
519519
<Skeleton className='h-4 w-12' />
520520
<Skeleton className='h-8 w-[100px] rounded-[8px]' />
521-
</div>
521+
</div> */}
522522

523523
{/* Auto-connect row */}
524524
<div className='flex items-center justify-between'>

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components-new/settings-modal/settings-modal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ export function SettingsModal({ open, onOpenChange }: SettingsModalProps) {
279279
autoConnect: data.autoConnect ?? true,
280280
showTrainingControls: data.showTrainingControls ?? false,
281281
superUserModeEnabled: data.superUserModeEnabled ?? true,
282-
theme: data.theme || 'system',
282+
// Force dark mode - light mode is temporarily disabled
283+
theme: 'dark' as const,
283284
telemetryEnabled: data.telemetryEnabled ?? true,
284285
billingUsageNotificationsEnabled: data.billingUsageNotificationsEnabled ?? true,
285286
}

apps/sim/hooks/queries/general-settings.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ async function fetchGeneralSettings(): Promise<GeneralSettings> {
4343
autoConnect: data.autoConnect ?? true,
4444
showTrainingControls: data.showTrainingControls ?? false,
4545
superUserModeEnabled: data.superUserModeEnabled ?? true,
46-
theme: data.theme || 'system',
46+
// theme: data.theme || 'system',
47+
// Force dark mode - light mode is temporarily disabled (TODO: Remove this)
48+
theme: 'dark' as const,
4749
telemetryEnabled: data.telemetryEnabled ?? true,
4850
billingUsageNotificationsEnabled: data.billingUsageNotificationsEnabled ?? true,
4951
errorNotificationsEnabled: data.errorNotificationsEnabled ?? true,

apps/sim/lib/core/utils/theme.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,30 @@
55
/**
66
* Updates the theme in next-themes by dispatching a storage event.
77
* This works by updating localStorage and notifying next-themes of the change.
8-
* @param theme - The theme to apply: 'system', 'light', or 'dark'
8+
* NOTE: Light mode is temporarily disabled - this function always forces dark mode.
9+
* @param _theme - The theme parameter (currently ignored, dark mode is forced)
910
*/
10-
export function syncThemeToNextThemes(theme: 'system' | 'light' | 'dark') {
11+
export function syncThemeToNextThemes(_theme: 'system' | 'light' | 'dark') {
1112
if (typeof window === 'undefined') return
1213

13-
localStorage.setItem('sim-theme', theme)
14+
// Force dark mode - light mode is temporarily disabled
15+
const forcedTheme = 'dark'
16+
17+
localStorage.setItem('sim-theme', forcedTheme)
1418

1519
window.dispatchEvent(
1620
new StorageEvent('storage', {
1721
key: 'sim-theme',
18-
newValue: theme,
22+
newValue: forcedTheme,
1923
oldValue: localStorage.getItem('sim-theme'),
2024
storageArea: localStorage,
2125
url: window.location.href,
2226
})
2327
)
2428

2529
const root = document.documentElement
26-
const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
27-
const actualTheme = theme === 'system' ? systemTheme : theme
28-
2930
root.classList.remove('light', 'dark')
30-
root.classList.add(actualTheme)
31+
root.classList.add('dark')
3132
}
3233

3334
/**

0 commit comments

Comments
 (0)