에디터 기본 배경색 문제
CSS 선택자 특정 문제
다크모드 구현 방식 이해 부족
/* 기본 스타일 */
.toast-editor-wrapper .toastui-editor-defaultUI {
background-color: white;
}
.toast-editor-wrapper .toastui-editor-defaultUI-toolbar {
background-color: #f8f9fa;
}
.toast-editor-wrapper .toastui-editor-contents {
background-color: white;
}
/* 헤딩 드롭다운 메뉴 스타일 */
.toastui-editor-popup {
background-color: white;
}
.toastui-editor-popup-body {
color: black;
}
.toastui-editor-popup-body button {
color: black;
}
.toastui-editor-popup-body button:hover {
background-color: #f1f1f1;
}
/* 다크모드 스타일 */
@media (prefers-color-scheme: dark) {
.dark .toast-editor-wrapper .toastui-editor-defaultUI {
background-color: #1a1a1a;
border-color: #404040;
}
.dark .toast-editor-wrapper .toastui-editor-defaultUI-toolbar {
background-color: #262626;
border-bottom-color: #404040;
}
.dark .toast-editor-wrapper .toastui-editor-contents {
background-color: #1a1a1a;
color: #e5e5e5;
}
.dark .toast-editor-wrapper .toastui-editor-toolbar-icons {
filter: invert(1);
}
.dark .toastui-editor-popup {
background-color: #262626;
}
.dark .toastui-editor-popup-body {
color: #e5e5e5;
}
.dark .toastui-editor-popup-body button {
color: #e5e5e5;
}
.dark .toastui-editor-popup-body button:hover {
background-color: #404040;
}
}
검증 포인트:
darkMode: 'class'
@media (조건) {
/* 조건이 충족될 때 적용될 스타일 */
}
/* 화면 크기 */
@media (min-width: 768px) { }
/* 다크모드 감지 */
@media (prefers-color-scheme: dark) { }
/* 기기 방향 */
@media (orientation: portrait) { }
이번 트러블 슈팅을 통해 서드파티 라이브러리의 스타일 커스터마이징, CSS 선택자 활용, 다크모드 구현 패턴에 대한 실제적인 경험을 얻을 수 있었습니다.
Tailwind CSS의 다크모드 설정과 미디어 쿼리를 결합하여 더욱 강력한 다크모드 구현이 가능했습니다.