Skip to content

Commit a623e9b

Browse files
authored
[Style] 달력 색상 변경
[Style] 달력 커스텀
2 parents 6c1e79b + 2e1c5ac commit a623e9b

File tree

2 files changed

+61
-12
lines changed

2 files changed

+61
-12
lines changed

src/components/modalInput/ModalInput.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import { inputClassNames } from "./InputClassNames";
77
import clsx from "clsx";
88
import { format } from "date-fns";
99
import { toast } from "react-toastify";
10+
import { ko } from "date-fns/locale";
11+
import { registerLocale } from "react-datepicker";
1012

13+
registerLocale("ko", ko);
1114
type ModalInputType = "제목" | "마감일" | "태그";
1215

1316
interface ModalInputProps {
@@ -162,6 +165,7 @@ export default function ModalInput({
162165
priority
163166
/>
164167
<DatePicker
168+
locale="ko"
165169
selected={selectedDate}
166170
onChange={handleDateChange}
167171
showTimeSelect

src/styles/globals.css

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -333,49 +333,94 @@
333333
transform: translateY(50px) !important;
334334
}
335335

336+
/* 달력 상단 헤더 & 시간 헤더 배경색 변경 */
337+
.custom-datepicker-popper .react-datepicker-time__header {
338+
color: transparent !important;
339+
position: relative;
340+
font-size: 0 !important;
341+
line-height: 20px;
342+
}
343+
344+
.custom-datepicker-popper .react-datepicker__header {
345+
background: #f1effd;
346+
}
347+
348+
.custom-datepicker-popper .react-datepicker-time__header::after {
349+
content: "시간";
350+
font-size: 12px; /* 원하는 크기로 조절 */
351+
color: #333236;
352+
position: absolute;
353+
top: 50%;
354+
left: 50%;
355+
transform: translate(-50%, -50%);
356+
}
357+
358+
/* 모바일 대응 */
336359
@media (max-width: 640px) {
337360
.custom-datepicker-popper {
338-
font-size: 8px !important;
361+
font-size: 10px !important;
339362
}
340-
341-
/*시간 선택 컨테이너 폭 줄이기 */
363+
/* 시간 선택 컨테이너 폭 줄이기 */
342364
.custom-datepicker-popper .react-datepicker__time-container {
343-
width: 45px !important; /* 기존: 45px */
365+
display: flex;
366+
flex-direction: column;
367+
justify-content: stretch;
368+
height: 100% !important;
369+
width: 45px !important;
344370
}
345371

346-
/*내부 time wrapper 폭 줄이기 */
372+
.custom-datepicker-popper .react-datepicker__month-container {
373+
height: 100% !important;
374+
}
375+
376+
.custom-datepicker-popper .react-datepicker {
377+
display: flex;
378+
align-items: stretch;
379+
height: auto !important;
380+
min-height: 200px; /* 원하는 높이로 조정 가능 */
381+
}
382+
383+
/* 내부 time wrapper 폭 줄이기 */
347384
.custom-datepicker-popper .react-datepicker__time {
348385
width: 45px !important;
349386
}
350387

351388
.custom-datepicker-popper .react-datepicker__time-box {
352389
width: 100% !important;
390+
height: 100% !important;
353391
}
354392

355-
/*리스트 padding/폭 조절 */
393+
/* 리스트 padding/폭 조절 */
356394
.custom-datepicker-popper .react-datepicker__time-list {
357-
padding: 2px !important;
358-
line-height: 1.2 !important;
395+
line-height: 2 !important;
359396
width: 100% !important;
360397
text-align: center !important;
361398
}
362399

363400
.custom-datepicker-popper .react-datepicker__time-list-item {
364-
font-size: 9px !important;
401+
font-size: 12px !important;
365402
padding: 2px 2px !important;
366403
height: auto !important;
367404
word-break: keep-all !important;
368405
box-sizing: border-box !important;
369406
}
370407

371-
/*선택된 항목 스타일 안정화 */
408+
/* 선택된 항목 스타일 */
372409
.custom-datepicker-popper .react-datepicker__time-list-item--selected {
373-
font-size: 8px !important;
374-
padding: 2px 2px !important;
410+
font-size: 12px !important;
375411
border-radius: 4px !important;
376412
background-color: #216ba5 !important;
377413
color: white !important;
378414
box-sizing: border-box !important;
379415
overflow: hidden !important;
380416
}
381417
}
418+
419+
.custom-datepicker-popper .react-datepicker,
420+
.custom-datepicker-popper .react-datepicker__day,
421+
.custom-datepicker-popper .react-datepicker__day-name,
422+
.custom-datepicker-popper .react-datepicker__current-month,
423+
.custom-datepicker-popper .react-datepicker-time__header,
424+
.custom-datepicker-popper .react-datepicker__time-list-item {
425+
color: #333236 !important;
426+
}

0 commit comments

Comments
 (0)