diff --git a/frontend/src/design-system/DesignSystemApp.tsx b/frontend/src/design-system/DesignSystemApp.tsx index edb916a..cc517c7 100644 --- a/frontend/src/design-system/DesignSystemApp.tsx +++ b/frontend/src/design-system/DesignSystemApp.tsx @@ -43,6 +43,22 @@ function DesignSystemShell() { root.classList.add(theme); }, [theme]); + // 단축키: 'a' 입력 시 테마 전환 (input/textarea 등 편집 중에는 무시) + useEffect(() => { + const handler = (e: KeyboardEvent) => { + if (e.key !== 'a' && e.key !== 'A') return; + if (e.ctrlKey || e.metaKey || e.altKey) return; + const target = e.target as HTMLElement | null; + const tag = target?.tagName; + if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || target?.isContentEditable) { + return; + } + setTheme((prev) => (prev === 'dark' ? 'light' : 'dark')); + }; + window.addEventListener('keydown', handler); + return () => window.removeEventListener('keydown', handler); + }, []); + // 스크롤 감지로 현재 네비 하이라이트 useEffect(() => { const observer = new IntersectionObserver( @@ -87,9 +103,11 @@ function DesignSystemShell() {