Skip to content

Add light/dark theme toggle and dynamic color system - #5

Open
luw2007 wants to merge 2 commits into
batu3384:mainfrom
luw2007:feature/theme-toggle
Open

luw2007 wants to merge 2 commits into
batu3384:mainfrom
luw2007:feature/theme-toggle

Conversation

@luw2007

@luw2007 luw2007 commented Sep 11, 2026

Copy link
Copy Markdown

Changes

Theme System

  • New ThemeMode enum: .system, .light, .dark
  • ThemeManager with @AppStorage persistence (survives app restarts)
  • Theme picker in Settings > General > Appearance (segmented control)
  • Applies preferredColorScheme to all windows (menu bar, settings, table editor)

Dynamic Color System

  • All hardcoded colors in ScreenTextGrabTheme.swift now use NSColor(name:dynamicProvider:) to adapt to light/dark appearance
  • New Color.stgWhite dynamic color (white in dark mode, black in light mode) replaces 57+ hardcoded .white text/fill occurrences
  • ShapeStyle extension so .stgWhite works in foregroundStyle, fill, stroke contexts

UI Refinements

  • Menu bar panel: ultraThinMaterial background with subtle tint (Raycast-inspired)
  • Settings cards: 12px corner radius, 0.5px dynamic border, compact padding, SF Pro typography
  • All existing UI components automatically support both modes

Notes

  • Default theme is .system (follows macOS), so existing users see no change unless they switch
  • The dynamic color approach is backward-compatible: all existing color references continue to work

Features:
- Theme system with system/light/dark modes (ThemeManager + @AppStorage)
- Dynamic color palette that adapts to appearance (all existing colors
  made dynamic via NSColor(name:dynamicProvider:))
- Theme picker in Settings > General > Appearance (segmented control)
- Raycast-style menu bar panel: ultraThinMaterial background with tint
- Raycast-style settings cards: 12px corner radius, 0.5px dynamic border,
  compact padding, SF Pro typography
- Applies preferredColorScheme to all windows (menu bar, settings, table editor)

All existing UI components automatically support both modes because the
hardcoded colors in ScreenTextGrabTheme.swift are now dynamic.
Replace all hardcoded .white / Color.white text and fill colors with
dynamic stgWhite (white in dark mode, black in light mode).

- Add Color.stgWhite dynamic color via NSColor(name:dynamicProvider:)
- Add ShapeStyle extension so .stgWhite works in foregroundStyle/fill/stroke
- Batch replace 57+ occurrences across MenuBarView, MenuBarSharedComponents,
  MenuBarQuickSettingsSection, SettingsTabViews, TableReviewView
- Fix accidental NSColor.stgWhite in SelectionOverlay (use NSColor.white)
- Fix accidental self-reference in ScreenTextGrabTheme definition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant