-
Notifications
You must be signed in to change notification settings - Fork 1
custom CSS 추가 및 입력창 폰트 사이즈 조절 #232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
4d7762f
1a21f0c
ba4435f
0bc9885
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,3 +1,4 @@ | ||||||||||||||||||||||||||||||||
| import React, { useState } from "react"; | ||||||||||||||||||||||||||||||||
| import type { AccountsState } from "../state/AppContext"; | ||||||||||||||||||||||||||||||||
| import type { ColorScheme, ThemeMode } from "../utils/theme"; | ||||||||||||||||||||||||||||||||
| import { AccountSelector } from "./AccountSelector"; | ||||||||||||||||||||||||||||||||
|
|
@@ -24,6 +25,8 @@ type SettingsModalProps = { | |||||||||||||||||||||||||||||||
| onPomodoroFocusChange: (value: number) => void; | ||||||||||||||||||||||||||||||||
| onPomodoroBreakChange: (value: number) => void; | ||||||||||||||||||||||||||||||||
| onPomodoroLongBreakChange: (value: number) => void; | ||||||||||||||||||||||||||||||||
| customCss: string; | ||||||||||||||||||||||||||||||||
| onCustomCssApply: (value: string) => void; | ||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| export const SettingsModal = ({ | ||||||||||||||||||||||||||||||||
|
|
@@ -47,8 +50,12 @@ export const SettingsModal = ({ | |||||||||||||||||||||||||||||||
| pomodoroLongBreak, | ||||||||||||||||||||||||||||||||
| onPomodoroFocusChange, | ||||||||||||||||||||||||||||||||
| onPomodoroBreakChange, | ||||||||||||||||||||||||||||||||
| onPomodoroLongBreakChange | ||||||||||||||||||||||||||||||||
| onPomodoroLongBreakChange, | ||||||||||||||||||||||||||||||||
| customCss, | ||||||||||||||||||||||||||||||||
| onCustomCssApply | ||||||||||||||||||||||||||||||||
| }: SettingsModalProps) => { | ||||||||||||||||||||||||||||||||
| const [localCustomCss, setLocalCustomCss] = useState(customCss); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if (!open) { | ||||||||||||||||||||||||||||||||
| return null; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
@@ -207,6 +214,28 @@ export const SettingsModal = ({ | |||||||||||||||||||||||||||||||
| 모두 삭제 | ||||||||||||||||||||||||||||||||
| </button> | ||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||
| <div className="settings-item-divider" /> | ||||||||||||||||||||||||||||||||
| <details className="settings-custom-css"> | ||||||||||||||||||||||||||||||||
| <summary> | ||||||||||||||||||||||||||||||||
| <strong>Custom CSS</strong> | ||||||||||||||||||||||||||||||||
| <p>직접 CSS를 작성하여 스타일을 커스텀합니다.</p> | ||||||||||||||||||||||||||||||||
| </summary> | ||||||||||||||||||||||||||||||||
| <div className="settings-custom-css-content"> | ||||||||||||||||||||||||||||||||
| <textarea | ||||||||||||||||||||||||||||||||
| value={localCustomCss} | ||||||||||||||||||||||||||||||||
| onChange={(e) => setLocalCustomCss(e.target.value)} | ||||||||||||||||||||||||||||||||
| placeholder="/* 여기에 CSS를 입력하세요 */" | ||||||||||||||||||||||||||||||||
| rows={10} | ||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||
|
Comment on lines
+224
to
+229
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 접근성: AGENTS.md 원칙("버튼/아이콘에
Suggested change
|
||||||||||||||||||||||||||||||||
| <button | ||||||||||||||||||||||||||||||||
| type="button" | ||||||||||||||||||||||||||||||||
| className="settings-apply-button" | ||||||||||||||||||||||||||||||||
| onClick={() => onCustomCssApply(localCustomCss)} | ||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||
| 적용 (페이지 새로고침) | ||||||||||||||||||||||||||||||||
| </button> | ||||||||||||||||||||||||||||||||
|
Comment on lines
+230
to
+236
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Critical 수정 시 연동 필요: 버튼 텍스트 변경 App.tsx의
Suggested change
|
||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||
| </details> | ||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -352,6 +352,75 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: var(--color-action-danger-text); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-item-divider { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| height: 1px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: var(--color-settings-item-border); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| margin: 16px 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-custom-css { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border: 1px solid var(--color-settings-item-border); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 12px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| overflow: hidden; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| margin-top: 10px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-custom-css summary { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 12px 16px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cursor: pointer; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: var(--color-input-bg); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| user-select: none; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| list-style: none; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-custom-css summary::-webkit-details-marker { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| display: none; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+368
to
+378
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 기본 마커(
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-custom-css summary p { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| margin: 4px 0 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 12px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: var(--color-settings-item-text); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-custom-css[open] summary { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-bottom: 1px solid var(--color-settings-item-border); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-custom-css-content { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 16px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flex-direction: column; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gap: 12px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-custom-css-content textarea { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| width: 100%; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 12px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 8px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border: 1px solid var(--color-input-border); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: var(--color-input-bg); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: var(--color-input-text); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-family: monospace; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 12px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| resize: vertical; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-apply-button { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| height: 40px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: var(--color-action-bg); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: var(--color-action-text); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 8px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-weight: 600; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| transition: opacity 0.2s; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border: none; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cursor: pointer; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-apply-button:hover { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| opacity: 0.9; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .settings-item .account-add-wrapper { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flex-shrink: 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -775,6 +844,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border: none !important; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 0 !important; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-family: inherit; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 15px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟢 Nit: 폰트 사이즈 하드코딩
/* 예: theme variables에 추가 */
--font-size-compose: 15px;단, 현재 코드베이스에서 사이즈 변수를 별도 관리하지 않는다면 현행대로 유지해도 무방합니다. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| resize: vertical !important; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: transparent !important; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| min-height: 80px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -856,6 +926,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: var(--color-input-bg); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: var(--color-input-text); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-family: inherit; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 15px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .compose-actions { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Critical:
onCustomCssApply와useEffect로직 단절useEffect(L454-466)에서customCssstate를 감시하며 동적으로<style>태그를 관리하고 있지만, 이 콜백에서는setCustomCss()를 호출하지 않고window.location.reload()로 페이지를 리로드합니다.현재 "우연히 동작하는" 구조입니다:
useState(() => localStorage.getItem(...))초기값 로드 → useEffect 발화문제점:
수정 방향:
setCustomCss(value)를 호출하여 useEffect가 실시간 반영하도록 통일하고, 리로드를 제거합니다. 이 경우 SettingsModal의 버튼 텍스트도적용 (페이지 새로고침)→적용으로 변경이 필요합니다.