Skip to content

Commit 3158b62

Browse files
authored
feat: light, emcn, modals (#2104)
* feat: aligned current unassigned hex to old globals * feat: emcn modal, help-modal; improvement(ui): emcn textarea, emcn combobox, messages-input * improvement(modal): ui, transition * improvement: terminal expand, variables styling; refactor(float): hooks * improvement(invite-modal): emcn aligned * feat(terminal): height memory * improvement(invite-modal): skeleton ui * improvement(invite-modal): badges UI * feat: deploy-modal, emcn * refactor: deleted duplicate dark styles * feat: emcn, settings, light * improvement: emcn, settings * improvement: settings-modal, emcn * improvement: SSO, light-mode * improvement: EMCN, light * fix issues, run lint * fix: reverted mock data
1 parent 7de721e commit 3158b62

File tree

179 files changed

+10798
-10177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+10798
-10177
lines changed

.cursorrules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENSURE that you use the logger.info and logger.warn and logger.error instead of
88

99
## Comments
1010

11-
You must use TSDOC for comments. Do not use ==== for comments to separate sections.
11+
You must use TSDOC for comments. Do not use ==== for comments to separate sections. Do not leave any comments that are not TSDOC.
1212

1313
## Globals styles
1414

apps/sim/.cursorrules

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Sim App Architecture Guidelines
22

3-
You are building features in the Sim app following the architecture established by the sidebar-new component. This file defines the patterns, structures, and conventions you must follow.
3+
You are building features in the Sim app following the architecture. This file defines the patterns, structures, and conventions you must follow.
44

55
---
66

@@ -428,20 +428,22 @@ setSidebarWidth: (width) => {
428428
### Tailwind Classes
429429

430430
1. **No Inline Styles**: Use Tailwind utility classes exclusively
431-
2. **Dark Mode**: Always include dark mode variants (`dark:bg-[var(--surface-1)]`)
432-
3. **Exact Values**: Use exact values from design system (`text-[14px]`, `h-[25px]`)
433-
4. **clsx for Conditionals**: Use clsx() for conditional classes
434-
5. **Consistent Spacing**: Use spacing tokens (`gap-[8px]`, `px-[14px]`)
435-
6. **Transitions**: Add transitions for interactive states (`transition-colors`)
436-
7. **Prefer px units**: Use arbitrary px values over scale utilities (e.g., `px-[4px]` instead of `px-1`)
431+
2. **Dark Mode**: Include dark mode variants only when the value differs from light mode
432+
3. **No Duplicate Dark Classes**: Never add a `dark:` class when the value is identical to the light mode class (e.g., `text-[var(--text-primary)] dark:text-[var(--text-primary)]` is redundant - just use `text-[var(--text-primary)]`)
433+
4. **Exact Values**: Use exact values from design system (`text-[14px]`, `h-[25px]`)
434+
5. **cn for Conditionals**: Use `cn()` from `@/lib/utils` for conditional classes (wraps clsx + tailwind-merge for conflict resolution)
435+
6. **Consistent Spacing**: Use spacing tokens (`gap-[8px]`, `px-[14px]`)
436+
7. **Transitions**: Add transitions for interactive states (`transition-colors`)
437+
8. **Prefer px units**: Use arbitrary px values over scale utilities (e.g., `px-[4px]` instead of `px-1`)
437438

438439
```typescript
440+
import { cn } from '@/lib/utils'
441+
439442
<div
440-
className={clsx(
443+
className={cn(
441444
'base-classes that-always-apply',
442445
isActive && 'active-state-classes',
443-
disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer hover:bg-accent',
444-
'dark:bg-[var(--surface-1)] dark:border-[var(--border)]' // Dark mode variants
446+
disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer hover:bg-accent'
445447
)}
446448
>
447449
```
@@ -620,9 +622,10 @@ Before considering a component/hook complete, verify:
620622

621623
### Styling
622624
- [ ] No styles attributes (use className with Tailwind)
623-
- [ ] Dark mode variants included
625+
- [ ] Dark mode variants only when values differ from light mode
626+
- [ ] No duplicate dark: classes with identical values
624627
- [ ] Consistent spacing using design tokens
625-
- [ ] clsx for conditional classes
628+
- [ ] cn() for conditional classes
626629

627630
### Accessibility
628631
- [ ] Semantic HTML elements
@@ -652,6 +655,11 @@ Before considering a component/hook complete, verify:
652655
// ❌ Inline styles
653656
<div style={{ width: 200, marginTop: 10 }}>
654657

658+
// ❌ Duplicate dark mode classes (same value as light mode)
659+
<div className='text-[var(--text-primary)] dark:text-[var(--text-primary)]'>
660+
<div className='bg-[var(--surface-9)] dark:bg-[var(--surface-9)]'>
661+
<div className='hover:bg-[var(--border)] dark:hover:bg-[var(--border)]'>
662+
655663
// ❌ console.log
656664
console.log('Debug info')
657665

@@ -690,6 +698,14 @@ export function Component() {
690698
// ✅ Tailwind classes
691699
<div className='w-[200px] mt-[10px]'>
692700

701+
// ✅ No duplicate dark classes - CSS variables already handle theming
702+
<div className='text-[var(--text-primary)]'>
703+
<div className='bg-[var(--surface-9)]'>
704+
<div className='hover:bg-[var(--border)]'>
705+
706+
// ✅ Only add dark: when values differ between modes
707+
<div className='bg-[var(--surface-6)] dark:bg-[var(--surface-9)]'>
708+
693709
// ✅ Logger
694710
logger.info('Debug info', { context })
695711

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

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

10-
// Force dark mode for workspace pages and templates
11-
// Force light mode for certain public pages
10+
// Force light mode for public/marketing pages
11+
// Workspace and templates respect user's theme preference from settings
1212
const forcedTheme =
13-
pathname.startsWith('/workspace') || pathname.startsWith('/templates')
14-
? 'dark'
15-
: pathname === '/' ||
16-
pathname.startsWith('/login') ||
17-
pathname.startsWith('/signup') ||
18-
pathname.startsWith('/sso') ||
19-
pathname.startsWith('/terms') ||
20-
pathname.startsWith('/privacy') ||
21-
pathname.startsWith('/invite') ||
22-
pathname.startsWith('/verify') ||
23-
pathname.startsWith('/careers') ||
24-
pathname.startsWith('/changelog') ||
25-
pathname.startsWith('/chat') ||
26-
pathname.startsWith('/studio')
27-
? 'light'
28-
: undefined
13+
pathname === '/' ||
14+
pathname.startsWith('/login') ||
15+
pathname.startsWith('/signup') ||
16+
pathname.startsWith('/sso') ||
17+
pathname.startsWith('/terms') ||
18+
pathname.startsWith('/privacy') ||
19+
pathname.startsWith('/invite') ||
20+
pathname.startsWith('/verify') ||
21+
pathname.startsWith('/careers') ||
22+
pathname.startsWith('/changelog') ||
23+
pathname.startsWith('/chat') ||
24+
pathname.startsWith('/studio')
25+
? 'light'
26+
: undefined
2927

3028
return (
3129
<NextThemesProvider

0 commit comments

Comments
 (0)