diff --git a/grass-diary/src/App.tsx b/grass-diary/src/App.tsx
new file mode 100644
index 00000000..6c24fcac
--- /dev/null
+++ b/grass-diary/src/App.tsx
@@ -0,0 +1,26 @@
+import { useEffect } from 'react';
+import { RouterProvider } from 'react-router-dom';
+
+import router from './router';
+import { GlobalStyle } from './styles/GlobalStyle';
+import useTheme from '@hooks/useTheme';
+
+const App = () => {
+ const { isDarkMode } = useTheme();
+
+ useEffect(() => {
+ const root = document.body;
+
+ if (isDarkMode) root.setAttribute('data-theme', 'dark');
+ else root.removeAttribute('data-theme');
+ }, [isDarkMode]);
+
+ return (
+ <>
+
+
+ >
+ );
+};
+
+export default App;
diff --git a/grass-diary/public/assets/img/banner_record.svg b/grass-diary/src/assets/svg/banner_record.svg
similarity index 99%
rename from grass-diary/public/assets/img/banner_record.svg
rename to grass-diary/src/assets/svg/banner_record.svg
index e3322b9d..641ffc46 100644
--- a/grass-diary/public/assets/img/banner_record.svg
+++ b/grass-diary/src/assets/svg/banner_record.svg
@@ -4,10 +4,10 @@
-
-
+
+
-
+
diff --git a/grass-diary/src/assets/svg/chevron_left.svg b/grass-diary/src/assets/svg/chevron_left.svg
index 8e6f350d..5897c6dd 100644
--- a/grass-diary/src/assets/svg/chevron_left.svg
+++ b/grass-diary/src/assets/svg/chevron_left.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/public/assets/icons/darkTheme.svg b/grass-diary/src/assets/svg/darkTheme.svg
similarity index 80%
rename from grass-diary/public/assets/icons/darkTheme.svg
rename to grass-diary/src/assets/svg/darkTheme.svg
index 5da2b92b..671c15f8 100644
--- a/grass-diary/public/assets/icons/darkTheme.svg
+++ b/grass-diary/src/assets/svg/darkTheme.svg
@@ -1,3 +1,3 @@
diff --git a/grass-diary/src/assets/svg/event_note.svg b/grass-diary/src/assets/svg/event_note.svg
index 8961de6b..ff694fff 100755
--- a/grass-diary/src/assets/svg/event_note.svg
+++ b/grass-diary/src/assets/svg/event_note.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/public/assets/icons/expand-more.svg b/grass-diary/src/assets/svg/expand-more.svg
similarity index 76%
rename from grass-diary/public/assets/icons/expand-more.svg
rename to grass-diary/src/assets/svg/expand-more.svg
index 0970b8e1..e0b25c01 100644
--- a/grass-diary/public/assets/icons/expand-more.svg
+++ b/grass-diary/src/assets/svg/expand-more.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/src/assets/svg/favorite_border.svg b/grass-diary/src/assets/svg/favorite_border.svg
index 3f20a909..6a996831 100644
--- a/grass-diary/src/assets/svg/favorite_border.svg
+++ b/grass-diary/src/assets/svg/favorite_border.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/public/assets/icons/icon-btn-chevron-left.svg b/grass-diary/src/assets/svg/icon-btn-chevron-left.svg
similarity index 80%
rename from grass-diary/public/assets/icons/icon-btn-chevron-left.svg
rename to grass-diary/src/assets/svg/icon-btn-chevron-left.svg
index 76053fa4..1be4742a 100644
--- a/grass-diary/public/assets/icons/icon-btn-chevron-left.svg
+++ b/grass-diary/src/assets/svg/icon-btn-chevron-left.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/public/assets/icons/icon-btn-chevron-right.svg b/grass-diary/src/assets/svg/icon-btn-chevron-right.svg
similarity index 78%
rename from grass-diary/public/assets/icons/icon-btn-chevron-right.svg
rename to grass-diary/src/assets/svg/icon-btn-chevron-right.svg
index 9faa6e06..0afdc26c 100644
--- a/grass-diary/public/assets/icons/icon-btn-chevron-right.svg
+++ b/grass-diary/src/assets/svg/icon-btn-chevron-right.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/public/assets/icons/icon-btn-first-page.svg b/grass-diary/src/assets/svg/icon-btn-first-page.svg
similarity index 90%
rename from grass-diary/public/assets/icons/icon-btn-first-page.svg
rename to grass-diary/src/assets/svg/icon-btn-first-page.svg
index d94a940a..d631acc6 100644
--- a/grass-diary/public/assets/icons/icon-btn-first-page.svg
+++ b/grass-diary/src/assets/svg/icon-btn-first-page.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/public/assets/icons/icon-btn-last-page.svg b/grass-diary/src/assets/svg/icon-btn-last-page.svg
similarity index 90%
rename from grass-diary/public/assets/icons/icon-btn-last-page.svg
rename to grass-diary/src/assets/svg/icon-btn-last-page.svg
index 2bbea4d6..ef9f986e 100644
--- a/grass-diary/public/assets/icons/icon-btn-last-page.svg
+++ b/grass-diary/src/assets/svg/icon-btn-last-page.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/src/assets/svg/info.svg b/grass-diary/src/assets/svg/info.svg
index 61167781..1dd01cae 100755
--- a/grass-diary/src/assets/svg/info.svg
+++ b/grass-diary/src/assets/svg/info.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/public/assets/icons/lightTheme.svg b/grass-diary/src/assets/svg/lightTheme.svg
similarity index 82%
rename from grass-diary/public/assets/icons/lightTheme.svg
rename to grass-diary/src/assets/svg/lightTheme.svg
index 1ba82e9b..366f802d 100644
--- a/grass-diary/public/assets/icons/lightTheme.svg
+++ b/grass-diary/src/assets/svg/lightTheme.svg
@@ -1,3 +1,3 @@
diff --git a/grass-diary/src/assets/svg/lock.svg b/grass-diary/src/assets/svg/lock.svg
index 30b4bb94..8a1c8776 100644
--- a/grass-diary/src/assets/svg/lock.svg
+++ b/grass-diary/src/assets/svg/lock.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/src/assets/svg/lock_open.svg b/grass-diary/src/assets/svg/lock_open.svg
index 1dae842d..e88f4cff 100644
--- a/grass-diary/src/assets/svg/lock_open.svg
+++ b/grass-diary/src/assets/svg/lock_open.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/src/assets/svg/subdirectory_arrow_right.svg b/grass-diary/src/assets/svg/subdirectory_arrow_right.svg
index 1f8736da..cd7e99f3 100644
--- a/grass-diary/src/assets/svg/subdirectory_arrow_right.svg
+++ b/grass-diary/src/assets/svg/subdirectory_arrow_right.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/src/assets/svg/tag.svg b/grass-diary/src/assets/svg/tag.svg
index d5b02c9f..c9d452c9 100644
--- a/grass-diary/src/assets/svg/tag.svg
+++ b/grass-diary/src/assets/svg/tag.svg
@@ -1,5 +1,5 @@
diff --git a/grass-diary/src/components/Button/BackButton.tsx b/grass-diary/src/components/Button/BackButton.tsx
index 22b51dbd..bea3841c 100644
--- a/grass-diary/src/components/Button/BackButton.tsx
+++ b/grass-diary/src/components/Button/BackButton.tsx
@@ -8,15 +8,15 @@ interface IBackButtonProps {
const BackButton = ({ goBackTo }: IBackButtonProps) => {
const navigate = useNavigate();
const location = useLocation();
+
const goBack = () => {
- if (goBackTo) {
- return navigate(goBackTo);
- }
- if (location.state === 'editcomplete') {
- return navigate(-2);
- }
+ if (goBackTo) return navigate(goBackTo);
+
+ if (location.state === 'editcomplete') return navigate(-2);
+
navigate(-1);
};
+
return (
diff --git a/grass-diary/src/components/Comment/CommentDisplay.tsx b/grass-diary/src/components/Comment/CommentDisplay.tsx
index 7796cf24..e4e3ba86 100644
--- a/grass-diary/src/components/Comment/CommentDisplay.tsx
+++ b/grass-diary/src/components/Comment/CommentDisplay.tsx
@@ -7,19 +7,24 @@ import CommentSetting from './CommentSetting';
import { useTodayDate } from '@hooks/api/useTodayDate';
import { useUser } from '@state/user/useUser';
import { COMMENT } from '@constants/message';
+import useTheme from '@hooks/useTheme';
const CommentDisplay = ({ comment, parentId }: CommentDisplayProps) => {
- const { data: writer } = useWriterProfile(comment.memberId);
const memberId = useUser();
+ const setting = useRef(null);
+
const { setReplyId } = useCommentActions();
const { date } = useTodayDate();
- const setting = useRef(null);
+ const { isDarkMode } = useTheme();
+ const { data: writer } = useWriterProfile(comment.memberId);
+
const [isToday, setIsToday] = useState(false);
const reply = (e: React.MouseEvent) => {
if (setting.current) {
if (setting.current.contains(e.target as HTMLElement)) return;
}
+
setReplyId(parentId);
};
@@ -38,7 +43,9 @@ const CommentDisplay = ({ comment, parentId }: CommentDisplayProps) => {
return comment.deleted ? (
- {comment.depth ? : null}
+ {comment.depth ? (
+
+ ) : null}
{COMMENT.deleted}
@@ -46,7 +53,9 @@ const CommentDisplay = ({ comment, parentId }: CommentDisplayProps) => {
- {comment.depth ? : null}
+ {comment.depth ? (
+
+ ) : null}
{writer?.nickname}
diff --git a/grass-diary/src/components/Comment/Input.tsx b/grass-diary/src/components/Comment/Input.tsx
index 27a42a14..ec8ea3a5 100644
--- a/grass-diary/src/components/Comment/Input.tsx
+++ b/grass-diary/src/components/Comment/Input.tsx
@@ -9,6 +9,7 @@ import { usePostComment } from '@hooks/api/comment/usePostComment';
import { usePatchComment } from '@hooks/api/comment/usePatchComment';
import { ReactComponent as ReplyIcon } from '@svg/subdirectory_arrow_right.svg';
import { COMMENT } from '@constants/message';
+import useTheme from '@hooks/useTheme';
const CommentInput = ({
submit,
@@ -18,6 +19,7 @@ const CommentInput = ({
isCancelBtn,
isPatch,
}: CommentInputProps) => {
+ const { isDarkMode } = useTheme();
const { profileImageURL, nickname } = useProfile();
const { resetEditId, resetReplyId } = useCommentActions();
const [focus, setFocus] = useState(false);
@@ -54,7 +56,7 @@ const CommentInput = ({
- {isReply && }
+ {isReply && }
{nickname}
diff --git a/grass-diary/src/components/Container.tsx b/grass-diary/src/components/Container.tsx
index 08b2bfbc..2c77c38a 100644
--- a/grass-diary/src/components/Container.tsx
+++ b/grass-diary/src/components/Container.tsx
@@ -1,17 +1,15 @@
-import stylex from '@stylexjs/stylex';
-
-const styles = stylex.create({
- container: {
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
-
- gap: '10px',
- },
-});
+import styled from 'styled-components';
const Container = ({ children }: IContainer) => {
- return {children}
;
+ return {children};
};
export default Container;
+
+const SContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+
+ background: ${({ theme }) => theme.bg.solid.subtler};
+`;
diff --git a/grass-diary/src/components/Divider.tsx b/grass-diary/src/components/Divider.tsx
index 93e6d4f3..e9d3de55 100644
--- a/grass-diary/src/components/Divider.tsx
+++ b/grass-diary/src/components/Divider.tsx
@@ -1,4 +1,3 @@
-import { semantic } from '@styles/semantic';
import styled from 'styled-components';
interface IDividerProps {
@@ -19,8 +18,6 @@ const DividerLine = styled.div<{
width: ${({ $dividerWidth }) => $dividerWidth || '20rem'};
height: 0.0625rem;
- background: ${({ $dividerColor }) =>
- $dividerColor
- ? $dividerColor
- : `${semantic.light.border.transparent.neutral}`};
+ background: ${({ $dividerColor, theme }) =>
+ $dividerColor ? $dividerColor : `${theme.border.transparent.neutral}`};
`;
diff --git a/grass-diary/src/components/Feed/Feed.tsx b/grass-diary/src/components/Feed/Feed.tsx
index 7fab2956..56fab98e 100644
--- a/grass-diary/src/components/Feed/Feed.tsx
+++ b/grass-diary/src/components/Feed/Feed.tsx
@@ -10,6 +10,7 @@ import { useModal } from '@state/modal/useModal';
import { INTERACTION } from '@styles/interaction';
import { MODAL } from '@constants/message';
import { useUser } from '@state/user/useUser';
+import { API_URI } from '@services/index';
interface IFeedProps {
feed: Feed;
@@ -38,7 +39,7 @@ const Feed = ({ feed, isTop }: IFeedProps) => {
};
const handleGoogleLogin: TGoogleLogin = () => {
- window.open(`http://localhost:8080/api/auth/google`, '_self');
+ window.open(`${API_URI}/api/auth/google`, '_self');
};
const FeedClickHandler = () => {
diff --git a/grass-diary/src/components/Feed/PopularFeed.tsx b/grass-diary/src/components/Feed/PopularFeed.tsx
index 2ed19db4..bda004cf 100644
--- a/grass-diary/src/components/Feed/PopularFeed.tsx
+++ b/grass-diary/src/components/Feed/PopularFeed.tsx
@@ -11,32 +11,46 @@ import { Callout, Feed } from '@components/index';
import { usePopularDiaries } from '@hooks/api/usePopularDiaries';
import { Link, useLocation } from 'react-router-dom';
import { useEffect, useState } from 'react';
+import useTheme from '@hooks/useTheme';
const PrevArrow = (props: CustomArrowProps) => {
+ const { isDarkMode } = useTheme();
+
return (
);
};
const NextArrow = (props: CustomArrowProps) => {
+ const { isDarkMode } = useTheme();
+
return (
);
};
const PopularFeed = () => {
+ const { isDarkMode } = useTheme();
const { data: top10 } = usePopularDiaries();
const location = useLocation();
const [mobileSize, setMobileSize] = useState(false);
@@ -83,7 +97,11 @@ const PopularFeed = () => {
diff --git a/grass-diary/src/components/Layout/Header.tsx b/grass-diary/src/components/Layout/Header.tsx
index 03cac254..186c7686 100644
--- a/grass-diary/src/components/Layout/Header.tsx
+++ b/grass-diary/src/components/Layout/Header.tsx
@@ -1,15 +1,18 @@
-import * as S from '@styles/component/Layout/Header.style';
-import sampleLogo from '@image/sampleLogo.png';
+import { useNavigate } from 'react-router-dom';
+
import MenuBar from './MenuBar';
+import sampleLogo from '@image/sampleLogo.png';
+import * as S from '@styles/component/Layout/Header.style';
import { Profile } from '@components/index';
-import { useNavigate } from 'react-router-dom';
import { useUser } from '@state/user/useUser';
+import { API_URI } from '@services/index';
const Header = () => {
const memberId = useUser();
const navigate = useNavigate();
+
const handleGoogleLogin: TGoogleLogin = () => {
- window.open(`http://localhost:8080/api/auth/google`, '_self');
+ window.open(`${API_URI}/api/auth/google`, '_self');
};
return (
diff --git a/grass-diary/src/components/Layout/Layout.tsx b/grass-diary/src/components/Layout/Layout.tsx
index 2a845ce1..72b94a79 100644
--- a/grass-diary/src/components/Layout/Layout.tsx
+++ b/grass-diary/src/components/Layout/Layout.tsx
@@ -3,17 +3,22 @@ import Header from './Header';
import Footer from './Footer';
import SnackBar from './SnackBar';
import { Toast, Modal } from '@components/index';
+import { ThemeProvider } from 'styled-components';
+import { semantic } from '@styles/semantic';
+import useTheme from '@hooks/useTheme';
const Layout = () => {
+ const { isDarkMode } = useTheme();
+
return (
- <>
+
- >
+
);
};
diff --git a/grass-diary/src/components/Like/Like.tsx b/grass-diary/src/components/Like/Like.tsx
index 802177ac..88e10159 100644
--- a/grass-diary/src/components/Like/Like.tsx
+++ b/grass-diary/src/components/Like/Like.tsx
@@ -2,6 +2,7 @@ import * as S from '@styles/component/Like/Like.style';
import { useEffect, useState } from 'react';
import { useCountLike } from '@hooks/api/useCountLike';
import { useUser } from '@state/user/useUser';
+import useTheme from '@hooks/useTheme';
interface ILikeProps {
diaryId: Id;
@@ -11,8 +12,9 @@ interface ILikeProps {
}
const Like = ({ diaryId, likeCount, setLikeCount, liked }: ILikeProps) => {
- const [isPushed, setIsPushed] = useState(false);
const memberId = useUser();
+ const [isPushed, setIsPushed] = useState(false);
+ const { isDarkMode } = useTheme();
const { postLike, deleteLike, postSuccess, deleteSuccess } = useCountLike({
diaryId,
memberId,
@@ -44,7 +46,11 @@ const Like = ({ diaryId, likeCount, setLikeCount, liked }: ILikeProps) => {
return (
{likeCount}
- {isPushed ? : }
+ {isPushed ? (
+
+ ) : (
+
+ )}
);
};
diff --git a/grass-diary/src/components/Notification/Callout.tsx b/grass-diary/src/components/Notification/Callout.tsx
index 7dc1eff7..486e29cf 100644
--- a/grass-diary/src/components/Notification/Callout.tsx
+++ b/grass-diary/src/components/Notification/Callout.tsx
@@ -1,3 +1,4 @@
+import useTheme from '@hooks/useTheme';
import * as S from '@styles/component/Notification/Callout.style';
import { ReactComponent as Info } from '@svg/info.svg';
@@ -6,9 +7,13 @@ type CalloutProps = {
};
const Callout = ({ message }: CalloutProps) => {
+ const { isDarkMode } = useTheme();
return (
-
+
{message}
);
diff --git a/grass-diary/src/components/Notification/Modal.tsx b/grass-diary/src/components/Notification/Modal.tsx
index c218f4a3..0f5cc98a 100644
--- a/grass-diary/src/components/Notification/Modal.tsx
+++ b/grass-diary/src/components/Notification/Modal.tsx
@@ -10,6 +10,7 @@ import {
useModalButton1,
useModalButton2,
} from '@state/modal/ModalButtonStore';
+import { API_URI } from '@services/index';
const Modal = () => {
const login = useModalLogin();
@@ -20,7 +21,7 @@ const Modal = () => {
const { setLogin, setActive } = useModalActions();
const handleGoogleLogin: TGoogleLogin = () => {
- window.open(`http://localhost:8080/api/auth/google`, '_self');
+ window.open(`${API_URI}/api/auth/google`, '_self');
};
return (
diff --git a/grass-diary/src/components/modal/Modal.tsx b/grass-diary/src/components/modal/Modal.tsx
index c218f4a3..0f5cc98a 100644
--- a/grass-diary/src/components/modal/Modal.tsx
+++ b/grass-diary/src/components/modal/Modal.tsx
@@ -10,6 +10,7 @@ import {
useModalButton1,
useModalButton2,
} from '@state/modal/ModalButtonStore';
+import { API_URI } from '@services/index';
const Modal = () => {
const login = useModalLogin();
@@ -20,7 +21,7 @@ const Modal = () => {
const { setLogin, setActive } = useModalActions();
const handleGoogleLogin: TGoogleLogin = () => {
- window.open(`http://localhost:8080/api/auth/google`, '_self');
+ window.open(`${API_URI}/api/auth/google`, '_self');
};
return (
diff --git a/grass-diary/src/constants/message.ts b/grass-diary/src/constants/message.ts
index 79044f92..5894633c 100644
--- a/grass-diary/src/constants/message.ts
+++ b/grass-diary/src/constants/message.ts
@@ -128,7 +128,7 @@ export const SETTING_MESSAGES = {
label: {
nickname: '닉네임',
email: '이메일 주소',
- theme: '테마',
+ theme: '테마 변경',
withdraw: '회원 탈퇴',
},
message: {
@@ -255,4 +255,3 @@ export const SNACKBAR = {
page: '/rewardpage',
},
} as const;
-
diff --git a/grass-diary/src/hooks/useLogout.ts b/grass-diary/src/hooks/useLogout.ts
index 12001eed..988eab21 100644
--- a/grass-diary/src/hooks/useLogout.ts
+++ b/grass-diary/src/hooks/useLogout.ts
@@ -1,6 +1,6 @@
import { useNavigate } from 'react-router-dom';
import { useAuthActions } from '@state/auth/authStore';
-import { useSetMemberId } from '@state/user/userStore';
+import { useSetMemberId } from '@state/user/UserStore';
const useLogout = () => {
const navigate = useNavigate();
diff --git a/grass-diary/src/hooks/useTheme.ts b/grass-diary/src/hooks/useTheme.ts
new file mode 100644
index 00000000..1ee9c58a
--- /dev/null
+++ b/grass-diary/src/hooks/useTheme.ts
@@ -0,0 +1,20 @@
+import { useState } from 'react';
+
+const useTheme = () => {
+ const localTheme = localStorage.getItem('theme');
+ const [isDarkMode, setIsDarkMode] = useState(localTheme === 'dark');
+
+ const setDarkMode = () => {
+ setIsDarkMode(true);
+ localStorage.setItem('theme', 'dark');
+ };
+
+ const setLightMode = () => {
+ setIsDarkMode(false);
+ localStorage.setItem('theme', 'light');
+ };
+
+ return { isDarkMode, setDarkMode, setLightMode };
+};
+
+export default useTheme;
diff --git a/grass-diary/src/main.tsx b/grass-diary/src/main.tsx
index 103928c2..2561707e 100644
--- a/grass-diary/src/main.tsx
+++ b/grass-diary/src/main.tsx
@@ -1,9 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { RecoilRoot } from 'recoil';
-import { RouterProvider } from 'react-router-dom';
-import router from './router';
-import { GlobalStyle } from './styles/GlobalStyle';
+
+import App from './App';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
@@ -14,8 +13,7 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
-
-
+
,
diff --git a/grass-diary/src/pages/CreateDiary/CreateDiary.tsx b/grass-diary/src/pages/CreateDiary/CreateDiary.tsx
index 2ed21a58..604e82a8 100644
--- a/grass-diary/src/pages/CreateDiary/CreateDiary.tsx
+++ b/grass-diary/src/pages/CreateDiary/CreateDiary.tsx
@@ -347,7 +347,7 @@ const CreateDiary = () => {
}, [diaryInfo]);
return (
- <>
+
@@ -535,7 +535,7 @@ const CreateDiary = () => {
- >
+
);
};
diff --git a/grass-diary/src/pages/DiaryDetail/DiaryDetail.tsx b/grass-diary/src/pages/DiaryDetail/DiaryDetail.tsx
index 064839cc..1bd26fd3 100644
--- a/grass-diary/src/pages/DiaryDetail/DiaryDetail.tsx
+++ b/grass-diary/src/pages/DiaryDetail/DiaryDetail.tsx
@@ -2,10 +2,10 @@ import * as S from '@styles/DiaryDetail/DiaryDetail.style';
import { useState, useEffect } from 'react';
import DOMPurify from 'dompurify';
-import { BackButton, Like, Comments } from '@components/index';
-import EMOJI from '@constants/emoji';
-import ImageModal from './modal/ImageModal';
import Setting from './Setting';
+import ImageModal from './modal/ImageModal';
+import EMOJI from '@constants/emoji';
+import { BackButton, Like, Comments } from '@components/index';
import { useDiaryDetail } from '@hooks/api/useDiaryDetail';
import { useParamsId } from '@hooks/useParamsId';
@@ -15,12 +15,16 @@ import { ReactComponent as AvatarBg } from '@svg/avatarBg.svg';
import { ReactComponent as LockOpen } from '@svg/lock_open.svg';
import { ReactComponent as Lock } from '@svg/lock.svg';
import { ReactComponent as Tag } from '@svg/tag.svg';
+import useTheme from '@hooks/useTheme';
const DiaryDetail = () => {
const diaryId = useParamsId();
const memberId = useUser();
+
const [likeCount, setLikeCount] = useState(0);
const [imageModal, setImageModal] = useState(false);
+
+ const { isDarkMode } = useTheme();
const { detail, writer } = useDiaryDetail(diaryId);
const zoom = () => {
@@ -69,7 +73,11 @@ const DiaryDetail = () => {
{detail && (
<>
- {detail.isPrivate ? : }
+ {detail.isPrivate ? (
+
+ ) : (
+
+ )}
{detail.isPrivate ? '비공개' : '공개'}
@@ -104,8 +112,8 @@ const DiaryDetail = () => {
{detail?.tags?.map(tag => {
return (
-
-
+
+
{tag.tag}
);
diff --git a/grass-diary/src/pages/EditDiary/EditDiary.tsx b/grass-diary/src/pages/EditDiary/EditDiary.tsx
index 07d33c8a..952edc3c 100644
--- a/grass-diary/src/pages/EditDiary/EditDiary.tsx
+++ b/grass-diary/src/pages/EditDiary/EditDiary.tsx
@@ -277,7 +277,7 @@ const EditDiary = () => {
}, [diaryInfo]);
return (
- <>
+
@@ -461,7 +461,7 @@ const EditDiary = () => {
- >
+
);
};
diff --git a/grass-diary/src/pages/Intro/Intro.tsx b/grass-diary/src/pages/Intro/Intro.tsx
index 388d0a3c..fb880537 100644
--- a/grass-diary/src/pages/Intro/Intro.tsx
+++ b/grass-diary/src/pages/Intro/Intro.tsx
@@ -1,4 +1,5 @@
import * as S from '@styles/Intro/IntroStyles';
+import useTheme from '@hooks/useTheme';
import {
FirstSection,
LastSection,
@@ -7,8 +8,10 @@ import {
} from './introComponents';
const Intro = () => {
+ const { isDarkMode } = useTheme();
+
return (
-
+
diff --git a/grass-diary/src/pages/Intro/introComponents.tsx b/grass-diary/src/pages/Intro/introComponents.tsx
index 25e92b38..6e179a26 100644
--- a/grass-diary/src/pages/Intro/introComponents.tsx
+++ b/grass-diary/src/pages/Intro/introComponents.tsx
@@ -5,12 +5,16 @@ import { useModal } from '@state/modal/useModal';
import { checkAuth } from '@utils/authUtils';
import * as S from '@styles/Intro/IntroStyles';
+import useTheme from '@hooks/useTheme';
+import useIsMobile from '@hooks/useIsMobile';
import { Divider } from '@components/index';
import { INTRO_MESSAGES } from '@constants/message';
-import useIsMobile from '@hooks/useIsMobile';
+import { ReactComponent as ScrollIcon } from '@svg/expand-more.svg';
+import { ReactComponent as RecordImage } from '@svg/banner_record.svg';
const OpenModalButton = () => {
const navigate: NavigateFunction = useNavigate();
+
const { loginModal } = useModal();
const [isLoggedIn, setIsLoggedIn] = useState(false);
@@ -45,6 +49,7 @@ const OpenModalButton = () => {
const FirstSection = () => {
const isMobile = useIsMobile();
+ const { isDarkMode } = useTheme();
return (
<>
@@ -64,7 +69,11 @@ const FirstSection = () => {
{INTRO_MESSAGES.firstSection.scrollMessage(isMobile)}
-
+
>
);
@@ -72,6 +81,7 @@ const FirstSection = () => {
const SecondSection = () => {
const isMobile = useIsMobile();
+ const { isDarkMode } = useTheme();
return (
@@ -86,7 +96,7 @@ const SecondSection = () => {
{INTRO_MESSAGES.secondSection.secondIntroduction(isMobile)}
-
+
);
diff --git a/grass-diary/src/pages/Main/BottomSection.tsx b/grass-diary/src/pages/Main/BottomSection.tsx
index 7a69213d..17784ac2 100644
--- a/grass-diary/src/pages/Main/BottomSection.tsx
+++ b/grass-diary/src/pages/Main/BottomSection.tsx
@@ -1,15 +1,16 @@
import * as S from '@styles/Main/BottomSection.style';
import AnimateReward from './AnimateReward';
+import useTheme from '@hooks/useTheme';
import { semantic } from '@styles/semantic';
import { useReward } from '@hooks/api/useReward';
import { useModal } from '@state/modal/useModal';
import { MAIN_MESSAGES, MODAL } from '@constants/message';
import { ReactComponent as Avatar } from '@svg/avatarBg.svg';
import { ReactComponent as Arrow } from '@svg/chevron_right.svg';
-import { ReactComponent as ArrowBlack } from '@svg/chevron_right_black.svg';
const BottomSection = () => {
+ const { isDarkMode } = useTheme();
const { reward } = useReward();
const { modal } = useModal();
@@ -66,7 +67,7 @@ const BottomSection = () => {
width={18}
height={18}
fill={semantic.light.accent.solid.hero}
- >
+ />
@@ -83,7 +84,11 @@ const BottomSection = () => {
{MAIN_MESSAGES.bottom_section.go_to_review}
-
+
diff --git a/grass-diary/src/pages/Main/TopSection.tsx b/grass-diary/src/pages/Main/TopSection.tsx
index 15c75568..e40b22c7 100644
--- a/grass-diary/src/pages/Main/TopSection.tsx
+++ b/grass-diary/src/pages/Main/TopSection.tsx
@@ -5,8 +5,10 @@ import { useTodayQuestion } from '@hooks/api/useTodayQuestion';
import { MAIN_MESSAGES } from '@constants/message';
import { ReactComponent as EditNote } from '@svg/edit_note.svg';
import { ReactComponent as EventNote } from '@svg/event_note.svg';
+import useTheme from '@hooks/useTheme';
const TopSection = () => {
+ const { isDarkMode } = useTheme();
// 질문 데이터를 가져오는 쿼리
const { question } = useTodayQuestion();
// 날짜 데이터를 가져오는 쿼리
@@ -47,7 +49,7 @@ const TopSection = () => {
{MAIN_MESSAGES.top_section.my_diary}
-
+
diff --git a/grass-diary/src/pages/MyPage/Diary.tsx b/grass-diary/src/pages/MyPage/Diary.tsx
index 5a1d4ebc..04290115 100644
--- a/grass-diary/src/pages/MyPage/Diary.tsx
+++ b/grass-diary/src/pages/MyPage/Diary.tsx
@@ -5,16 +5,21 @@ import { useState, useEffect } from 'react';
import { useQuery } from '@tanstack/react-query';
import { useNavigate, useSearchParams } from 'react-router-dom';
-import API from '@services/index';
-
-import { semantic } from '@styles/semantic';
-import useDiary from '@hooks/api/useDiary';
-import { useUser } from '@state/user/useUser';
import { ReactComponent as FavoriteIcon } from '@svg/favorite.svg';
import { ReactComponent as CommentIcon } from '@svg/comment.svg';
-import { MoodProfile, Profile, Divider } from '@components/index';
+import { ReactComponent as FirstPage } from '@svg/icon-btn-first-page.svg';
+import { ReactComponent as LastPage } from '@svg/icon-btn-last-page.svg';
+import { ReactComponent as PreviousPage } from '@svg/icon-btn-chevron-left.svg';
+import { ReactComponent as NextPage } from '@svg/icon-btn-chevron-right.svg';
+
+import API from '@services/index';
+import useDiary from '@hooks/api/useDiary';
import Setting from '@pages/DiaryDetail/Setting';
+import { semantic } from '@styles/semantic';
+import { useUser } from '@state/user/useUser';
import { END_POINT } from '@constants/api';
+import { MoodProfile, Profile, Divider } from '@components/index';
+import useTheme from '@hooks/useTheme';
interface IPagination {
pageSize: number;
@@ -23,6 +28,7 @@ interface IPagination {
}
const Pagination = ({ pageSize, currentPage, onPageChange }: IPagination) => {
+ const { isDarkMode } = useTheme();
const handleFirstPage = () => onPageChange(0);
const handlePreviousPage = () => {
@@ -40,10 +46,10 @@ const Pagination = ({ pageSize, currentPage, onPageChange }: IPagination) => {
return (
-
+
-
+
{Array.from({ length: pageSize }, (_, index) => (
onPageChange(index)}>
@@ -51,10 +57,10 @@ const Pagination = ({ pageSize, currentPage, onPageChange }: IPagination) => {
))}
-
+
-
+
);
diff --git a/grass-diary/src/pages/MyPage/Grass.tsx b/grass-diary/src/pages/MyPage/Grass.tsx
index c400cde0..7b9c6a10 100644
--- a/grass-diary/src/pages/MyPage/Grass.tsx
+++ b/grass-diary/src/pages/MyPage/Grass.tsx
@@ -33,10 +33,11 @@ const createGrass: TCreateGrass = () => {
};
interface IGrass {
+ isDarkMode: boolean;
setSelectedDiary: React.Dispatch>;
}
-const Grass = ({ setSelectedDiary }: IGrass) => {
+const Grass = ({ setSelectedDiary, isDarkMode }: IGrass) => {
const memberId = useUser();
const grassColors = useGrass(memberId);
const { year, grass } = createGrass();
@@ -102,12 +103,18 @@ const Grass = ({ setSelectedDiary }: IGrass) => {
onMouseOut={() => handleGrassHover(null)}
$border={
!writeDay
- ? `1px solid ${semantic.light.accent.solid.normal}`
+ ? isDarkMode
+ ? `1px solid ${semantic.dark.accent.solid.normal}`
+ : `1px solid ${semantic.light.accent.solid.normal}`
+ : isDarkMode
+ ? `1px solid ${semantic.dark.border.transparent.alternative}`
: `1px solid ${semantic.light.border.transparent.alternative}`
}
$background={
grassColors[writeDay]
? `rgba(${grassColors[writeDay]})`
+ : isDarkMode
+ ? `${semantic.dark.fill.transparent.assistive}`
: `${semantic.light.fill.transparent.assistive}`
}
/>
diff --git a/grass-diary/src/pages/MyPage/MyPage.tsx b/grass-diary/src/pages/MyPage/MyPage.tsx
index b06c2c99..35bd3dd9 100644
--- a/grass-diary/src/pages/MyPage/MyPage.tsx
+++ b/grass-diary/src/pages/MyPage/MyPage.tsx
@@ -1,9 +1,12 @@
import { MainContainer } from './myComponents';
import * as S from '../../styles/MyPage/MyStyles';
+import useTheme from '@hooks/useTheme';
const MyPage = () => {
+ const { isDarkMode } = useTheme();
+
return (
-
+
);
diff --git a/grass-diary/src/pages/MyPage/myComponents.tsx b/grass-diary/src/pages/MyPage/myComponents.tsx
index f9e44ea8..45ef16f2 100644
--- a/grass-diary/src/pages/MyPage/myComponents.tsx
+++ b/grass-diary/src/pages/MyPage/myComponents.tsx
@@ -6,6 +6,7 @@ import Diary from './Diary';
import * as S from '../../styles/MyPage/MyStyles';
import { EllipsisBox, EllipsisIcon, Profile } from '@components/index';
import { useProfile } from '@state/profile/useProfile';
+import useTheme from '@hooks/useTheme';
const MainContainer = () => {
const navigate = useNavigate();
@@ -58,6 +59,7 @@ interface IProfileSection {
}
const ProfileSection = ({ setSelectedDiary }: IProfileSection) => {
+ const { isDarkMode } = useTheme();
const { nickname, profileIntro } = useProfile();
return (
@@ -73,7 +75,7 @@ const ProfileSection = ({ setSelectedDiary }: IProfileSection) => {
2024년 잔디 현황
-
+
>
);
diff --git a/grass-diary/src/pages/Setting/Setting.tsx b/grass-diary/src/pages/Setting/Setting.tsx
index 48394a1e..b5e6b153 100644
--- a/grass-diary/src/pages/Setting/Setting.tsx
+++ b/grass-diary/src/pages/Setting/Setting.tsx
@@ -1,19 +1,23 @@
import React, { useState } from 'react';
+import { ThemeProvider } from 'styled-components';
import {
QueryClient,
useMutation,
useQueryClient,
} from '@tanstack/react-query';
-import * as S from '../../styles/Setting/SettingStyles';
import API from '@services/index';
+import useTheme from '@hooks/useTheme';
+import { semantic } from '@styles/semantic';
+import * as S from '@styles/Setting/SettingStyles';
import { Profile } from '@components/index';
-import { END_POINT } from '@constants/api';
-import { CONSOLE_ERROR, SETTING_MESSAGES } from '@constants/message';
import { useProfile } from '@state/profile/useProfile';
import { useProfileActions } from '@state/profile/ProfileStore';
+import { END_POINT } from '@constants/api';
+import { CONSOLE_ERROR, SETTING_MESSAGES } from '@constants/message';
const Setting = () => {
+ const { isDarkMode, setDarkMode, setLightMode } = useTheme();
const queryClient: QueryClient = useQueryClient();
const { nickname, profileIntro }: omitProfileImageURL = useProfile();
const { setNickName, setProfileIntro } = useProfileActions();
@@ -49,144 +53,160 @@ const Setting = () => {
});
return (
-
-
-
-
-
-
-
-
-
- {nickname}
-
-
-
- {SETTING_MESSAGES.button.image('업로드')}
-
-
- {SETTING_MESSAGES.button.image('삭제')}
-
-
-
-
-
-
-
- setIsFocused(true)}
- onBlur={() => setIsFocused(false)}
+
+
+
+
+
+
+
+
+
+
+ {nickname}
+
+
+
+ {SETTING_MESSAGES.button.image('업로드')}
+
+
+ {SETTING_MESSAGES.button.image('삭제')}
+
+
+
+
+
+
+
+ setIsFocused(true)}
+ onBlur={() => setIsFocused(false)}
+ />
+
+
+
+
+
+ {profileIntro.length}/150자
+
+
+
+
+
+
+
+
+ {SETTING_MESSAGES.label.nickname}
+
+ {isEditingNickname ? (
+
-
-
-
-
-
- {profileIntro.length}/150자
-
-
-
-
-
-
-
-
- {SETTING_MESSAGES.label.nickname}
-
+ ) : (
+ {nickname}
+ )}
+
{isEditingNickname ? (
-
+
+ updateProfile.mutate({
+ nickname: editNickname,
+ profileIntro,
+ })
+ }
+ >
+ {SETTING_MESSAGES.button.save}
+
) : (
- {nickname}
+ setIsEditingNickname(true)}>
+ {SETTING_MESSAGES.button.amend}
+
)}
-
- {isEditingNickname ? (
-
- updateProfile.mutate({
- nickname: editNickname,
- profileIntro,
- })
- }
- >
- {SETTING_MESSAGES.button.save}
-
- ) : (
- setIsEditingNickname(true)}>
- {SETTING_MESSAGES.button.amend}
-
- )}
-
-
- {SETTING_MESSAGES.message.nickname}
-
-
-
-
-
-
- {SETTING_MESSAGES.label.email}
- username@gmail.com
-
-
-
- {SETTING_MESSAGES.message.email}
-
-
- {/*
+
+
+ {SETTING_MESSAGES.message.nickname}
+
+
+
+
+
+
+
+ {SETTING_MESSAGES.label.email}
+
+ username@gmail.com
+
+
+
+ {SETTING_MESSAGES.message.email}
+
+
+ {/*
*/}
-
-
-
- {SETTING_MESSAGES.label.theme}
+
+
+
+ {SETTING_MESSAGES.label.theme}
+
+ {SETTING_MESSAGES.message.theme}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {SETTING_MESSAGES.label.withdraw}
+
+
+ {SETTING_MESSAGES.button.withdraw}
+
+
- {SETTING_MESSAGES.message.theme}
+ {SETTING_MESSAGES.message.withdraw}
-
-
-
-
-
-
-
-
-
- {SETTING_MESSAGES.label.withdraw}
-
- {SETTING_MESSAGES.button.withdraw}
-
-
-
- {SETTING_MESSAGES.message.withdraw}
-
-
-
-
- updateProfile.mutate({
- nickname: nickname,
- profileIntro: profileIntro,
- })
- }
- >
- {SETTING_MESSAGES.button.apply}
-
-
- {SETTING_MESSAGES.button.navigate}
-
-
-
-
-
-
+
+
+
+ updateProfile.mutate({
+ nickname: nickname,
+ profileIntro: profileIntro,
+ })
+ }
+ >
+ {SETTING_MESSAGES.button.apply}
+
+
+ {SETTING_MESSAGES.button.navigate}
+
+
+
+
+
+
+
);
};
diff --git a/grass-diary/src/state/user/useUser.ts b/grass-diary/src/state/user/useUser.ts
index e12a0f8a..ff756259 100644
--- a/grass-diary/src/state/user/useUser.ts
+++ b/grass-diary/src/state/user/useUser.ts
@@ -1,7 +1,7 @@
import { useAuth } from '../auth/useAuth';
import { useEffect } from 'react';
import { useQuery } from '@tanstack/react-query';
-import { useMemberId, useSetMemberId } from './userStore';
+import { useMemberId, useSetMemberId } from './UserStore';
import API from '@services/index';
import { END_POINT } from '@constants/api';
diff --git a/grass-diary/src/styles/CreateDiary/CreateDiary.style.tsx b/grass-diary/src/styles/CreateDiary/CreateDiary.style.tsx
index cb594c6d..0b600b8f 100644
--- a/grass-diary/src/styles/CreateDiary/CreateDiary.style.tsx
+++ b/grass-diary/src/styles/CreateDiary/CreateDiary.style.tsx
@@ -1,31 +1,40 @@
import styled, { css, keyframes } from 'styled-components';
-import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
+export const CreateDiaryContainer = styled.div`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ background: ${({ theme }) => theme.bg.solid.subtler};
+`;
+
export const Layout = styled.div`
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ align-self: stretch;
+ flex: 1 0 0;
+
position: relative;
+
min-height: 100vh;
- display: flex;
- margin: 0 auto;
max-width: var(--vw-desktop-min, 60rem);
+
+ gap: var(--gap-lg, 1.25rem);
padding: var(--gap-xl, 1.5rem) var(--gap-9xl, 8.5rem) var(--gap-4xl, 3rem)
var(--gap-9xl, 8.5rem);
- flex-direction: column;
- align-items: flex-start;
- gap: var(--gap-lg, 1.25rem);
- flex: 1 0 0;
- align-self: stretch;
- border-top: var(--stroke-empty, 0px) solid
- ${semantic.light.border.transparent.alternative};
- border-right: var(--stroke-thin, 1px) solid
- ${semantic.light.border.transparent.alternative};
- border-bottom: var(--stroke-empty, 0px) solid
- ${semantic.light.border.transparent.alternative};
- border-left: var(--stroke-thin, 1px) solid
- ${semantic.light.border.transparent.alternative};
+ border-top: ${({ theme }) => `var(--stroke-empty, 0px) solid
+ ${theme.border.transparent.alternative}`};
+ border-right: ${({ theme }) => `var(--stroke-thin, 1px) solid
+ ${theme.border.transparent.alternative}`};
+ border-bottom: ${({ theme }) => `var(--stroke-empty, 0px) solid
+ ${theme.border.transparent.alternative}`};
+ border-left: ${({ theme }) => `var(--stroke-thin, 1px) solid
+ ${theme.border.transparent.alternative}`};
- background: ${semantic.light.bg.solid.subtlest};
+ background: ${({ theme }) => theme.bg.solid.subtlest};
@media screen and (max-width: 60em) {
display: grid;
@@ -55,17 +64,15 @@ export const SaveWrapContainer = styled.div`
`;
export const SaveWrapText = styled.p`
- color: ${semantic.light.object.transparent.neutral};
-
${TYPO.title1};
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const SaveWrapTime = styled.p`
flex: 1 0 0;
- color: ${semantic.light.object.transparent.alternative};
-
${TYPO.label1}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const SaveBtnContainer = styled.div`
@@ -89,16 +96,16 @@ export const SavePrevBtn = styled.button<{ disabled: boolean }>`
gap: var(--gap-2xs, 0.5rem);
border-radius: var(--radius-xs, 0.5rem);
- border: var(--stroke-thin, 1px) solid
- ${semantic.light.border.transparent.alternative};
+ border: ${({ theme }) =>
+ `var(--stroke-thin, 1px) solid ${theme.border.transparent.alternative}`};
- background: ${semantic.light.bg.solid.normal};
+ background: ${({ theme }) => theme.bg.solid.normal};
&:hover {
background: ${({ disabled }) =>
disabled
- ? semantic.light.bg.solid.normal
- : semantic.light.bg.solid.subtlest};
+ ? ({ theme }) => theme.bg.solid.normal
+ : ({ theme }) => theme.bg.solid.subtlest};
}
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
@@ -107,10 +114,10 @@ export const SavePrevBtn = styled.button<{ disabled: boolean }>`
`;
export const SavePrevBtnText = styled.p`
- color: ${semantic.light.object.transparent.alternative};
text-align: center;
${TYPO.label2}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const SaveBtn = styled.button<{ disabled: boolean }>`
@@ -121,29 +128,23 @@ export const SaveBtn = styled.button<{ disabled: boolean }>`
gap: var(--gap-2xs, 0.5rem);
border-radius: var(--radius-xs, 0.5rem);
- background: ${({ disabled }) =>
- disabled
- ? semantic.light.interactive.solid.disabled
- : semantic.light.accent.solid.normal};
+ background: ${({ disabled, theme }) =>
+ disabled ? theme.interactive.solid.disabled : theme.accent.solid.normal};
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
&:hover {
- background: ${({ disabled }) =>
- disabled
- ? semantic.light.interactive.solid.disabled
- : semantic.light.accent.solid.hero};
+ background: ${({ disabled, theme }) =>
+ disabled ? theme.interactive.solid.disabled : theme.accent.solid.hero};
}
transition: all 0.2s ease-in;
`;
export const SaveBtnText = styled.p<{ disabled: boolean }>`
- color: ${({ disabled }) =>
- disabled
- ? semantic.light.object.transparent.disabled
- : semantic.light.base.solid.white};
- text-align: center;
+ color: ${({ disabled, theme }) =>
+ disabled ? theme.object.transparent.disabled : theme.base.solid.white};
+ text-align: center;
${TYPO.label2}
`;
@@ -170,14 +171,16 @@ export const ModeBoxContainer = styled.div`
export const DiaryModeSelectorText = styled.p`
align-self: stretch;
- color: ${semantic.light.object.transparent.neutral};
+
${TYPO.label2}
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const DiaryModeSelectorSubText = styled.p`
align-self: stretch;
- color: ${semantic.light.object.transparent.alternative};
+
${TYPO.caption1}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const DailyQuestionBox = styled.div<{ $isSelected: boolean }>`
@@ -190,12 +193,12 @@ export const DailyQuestionBox = styled.div<{ $isSelected: boolean }>`
border: var(--stroke-thin, 1px) solid
${props =>
props.$isSelected
- ? semantic.light.accent.solid.hero
- : semantic.light.border.transparent.alternative};
+ ? props.theme.accent.solid.hero
+ : props.theme.border.transparent.alternative};
background: ${props =>
props.$isSelected
- ? semantic.light.accent.transparent.alternative
- : semantic.light.bg.solid.normal};
+ ? props.theme.accent.transparent.alternative
+ : ({ theme }) => theme.bg.solid.normal};
cursor: pointer;
`;
@@ -206,16 +209,18 @@ export const CustomEntryBox = styled.div<{ $isSelected: boolean }>`
align-items: center;
gap: var(--gap-lg, 1.25rem);
flex: 1 0 0;
+
border-radius: var(--radius-sm, 0.75rem);
border: var(--stroke-thin, 1px) solid
${props =>
props.$isSelected
- ? semantic.light.accent.solid.hero
- : semantic.light.border.transparent.alternative};
+ ? props.theme.accent.solid.hero
+ : props.theme.border.transparent.alternative};
+
background: ${props =>
props.$isSelected
- ? semantic.light.accent.transparent.alternative
- : semantic.light.bg.solid.normal};
+ ? props.theme.accent.transparent.alternative
+ : ({ theme }) => theme.bg.solid.normal};
cursor: pointer;
`;
@@ -232,11 +237,13 @@ export const ModeBtn = styled.div`
justify-content: center;
align-items: center;
border-radius: var(--radius-lg, 1.5rem);
- border: var(--stroke-thick, 0.125rem) solid
- ${semantic.light.border.transparent.normal};
- background: ${semantic.light.fill.transparent.assistive};
+ border: ${({ theme }) => `var(--stroke-thick, 0.125rem) solid
+ ${theme.border.transparent.normal}`};
+ background: ${({ theme }) => theme.fill.transparent.assistive};
cursor: pointer;
- transition: border 0.2s ease-in-out, border-color 0.2s ease-in-out;
+ transition:
+ border 0.2s ease-in-out,
+ border-color 0.2s ease-in-out;
&:hover {
box-shadow: 0 0 0 0.1rem lightgray;
@@ -244,9 +251,9 @@ export const ModeBtn = styled.div`
}
[type='radio']:checked + label {
- background: ${semantic.light.accent.transparent.hero};
- border: var(--stroke-thicker, 0.25rem) solid
- ${semantic.light.accent.solid.hero};
+ background: ${({ theme }) => theme.accent.transparent.hero};
+ border: ${({ theme }) =>
+ `var(--stroke-thicker, 0.25rem) solid ${theme.accent.solid.hero}`};
}
`;
@@ -266,7 +273,7 @@ export const DividerLine = styled.span`
width: 43rem;
height: 0.0625rem;
- background: ${semantic.light.border.transparent.alternative};
+ background: ${({ theme }) => theme.border.transparent.alternative};
`;
export const ImageLayout = styled.div`
@@ -291,15 +298,13 @@ export const Image = styled.div`
`;
export const ImageName = styled.p`
- color: ${semantic.light.object.transparent.neutral};
-
${TYPO.caption1}
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const ImageData = styled.p`
- color: ${semantic.light.object.transparent.assistive};
-
${TYPO.caption1}
+ color: ${({ theme }) => theme.object.transparent.assistive};
`;
export const ImageDelete = styled.div`
@@ -348,9 +353,8 @@ export const HashtagTitleBox = styled.div`
`;
export const HashtagTitle = styled.p`
- color: ${semantic.light.object.transparent.alternative};
-
${TYPO.label1}
+ color: ${({ theme }) => theme.object.transparent.alternative};
@media screen and (max-width: 60em) {
padding-top: 1.8em;
@@ -365,9 +369,9 @@ export const HashtagBox = styled.div`
align-self: stretch;
border-radius: var(--radius-xs, 0.5rem);
- border: var(--stroke-thin, 1px) solid
- ${semantic.light.border.transparent.alternative};
- background: ${semantic.light.bg.solid.normal};
+ border: ${({ theme }) =>
+ `var(--stroke-thin, 1px) solid ${theme.border.transparent.alternative}`};
+ background: ${({ theme }) => theme.bg.solid.normal};
`;
export const HashtagContent = styled.div`
@@ -385,12 +389,12 @@ export const HashtagInput = styled.input`
${TYPO.body1}
&::placeholder {
- color: ${semantic.light.object.transparent.assistive};
+ color: ${({ theme }) => theme.object.transparent.assistive};
}
`;
export const HashtagArrTitle = styled.p`
- color: ${semantic.light.accent.solid.hero};
+ color: ${({ theme }) => theme.accent.solid.hero};
font-size: 0.875rem;
font-style: normal;
@@ -418,7 +422,7 @@ export const CaptionText = styled.p<{ color: string }>`
${TYPO.caption1}
${props =>
- props.color === semantic.light.feedback.solid.negative &&
+ props.color === props.theme.feedback.solid.negative &&
css`
animation: ${CaptionTextShake} 0.3s ease;
`}
@@ -447,14 +451,15 @@ export const SelectablePublicBox = styled.div`
gap: var(--gap-lg, 1.25rem);
border-radius: var(--radius-xs, 0.5rem);
- border: var(--stroke-thin, 1px) solid
- ${semantic.light.border.transparent.alternative};
- background: ${semantic.light.bg.solid.normal};
+ border: ${({ theme }) =>
+ `var(--stroke-thin, 1px) solid ${theme.border.transparent.alternative}`};
+
+ background: ${({ theme }) => theme.bg.solid.normal};
`;
export const SelectablePublicText = styled.p`
- color: ${semantic.light.object.transparent.neutral};
${TYPO.label1}
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const SelectableSection = styled.div`
@@ -477,16 +482,21 @@ export const RadioBtn = styled.div`
label {
display: flex;
+ align-items: center;
+ justify-content: center;
+
width: 1.25rem;
height: 1.25rem;
- justify-content: center;
- align-items: center;
+
border-radius: var(--radius-lg, 1.5rem);
- border: var(--stroke-thick, 0.125rem) solid
- ${semantic.light.border.transparent.normal};
- background: ${semantic.light.fill.transparent.assistive};
+ border: ${({ theme }) => `var(--stroke-thick, 0.125rem) solid
+ ${theme.border.transparent.normal}`};
+ background: ${({ theme }) => theme.fill.transparent.assistive};
+
cursor: pointer;
- transition: border 0.2s ease-in-out, border-color 0.2s ease-in-out;
+ transition:
+ border 0.2s ease-in-out,
+ border-color 0.2s ease-in-out;
&:hover {
box-shadow: 0 0 0 0.1rem lightgray;
@@ -494,16 +504,15 @@ export const RadioBtn = styled.div`
}
[type='radio']:checked + label {
- background: ${semantic.light.accent.transparent.hero};
- border: var(--stroke-thicker, 0.25rem) solid
- ${semantic.light.accent.solid.hero};
+ background: ${({ theme }) => theme.accent.transparent.hero};
+ border: ${({ theme }) =>
+ `var(--stroke-thicker, 0.25rem) solid ${theme.accent.solid.hero}`};
}
`;
export const RadioText = styled.p`
- color: ${semantic.light.object.transparent.alternative};
-
${TYPO.label1}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const EmotionBox = styled.div`
@@ -513,9 +522,10 @@ export const EmotionBox = styled.div`
gap: var(--gap-lg, 1.25rem);
border-radius: var(--radius-xs, 0.5rem);
- border: var(--stroke-thin, 1px) solid
- ${semantic.light.border.transparent.alternative};
- background: ${semantic.light.bg.solid.normal};
+ border: ${({ theme }) =>
+ `var(--stroke-thin, 1px) solid ${theme.border.transparent.alternative}`};
+
+ background: ${({ theme }) => theme.bg.solid.normal};
@media screen and (max-width: 60em) {
width: 20em;
@@ -524,9 +534,8 @@ export const EmotionBox = styled.div`
`;
export const EmotionText = styled.p`
- color: ${semantic.light.object.transparent.neutral};
-
${TYPO.label1}
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const EmojiBox = styled.div`
@@ -541,10 +550,11 @@ export const EmojiSelectableBox = styled.div`
justify-content: center;
align-items: center;
- border: var(--stroke-thin, 0.06rem) solid
- ${semantic.light.border.transparent.normal};
+ border: ${({ theme }) =>
+ `var(--stroke-thin, 0.06rem) solid ${theme.border.transparent.normal}`};
border-radius: var(--radius-xs, 0.5rem);
- background: ${semantic.light.fill.transparent.alternative};
+
+ background: ${({ theme }) => theme.fill.transparent.alternative};
`;
export const EmojiInput = styled.input`
@@ -560,8 +570,8 @@ export const EmojiLabel = styled.label`
${EmojiInput}:checked + & {
padding: 0rem 0.2rem 0rem 0.2rem;
- background: ${semantic.light.accent.transparent.hero};
- border: var(--stroke-thicker, 0.1rem) solid
- ${semantic.light.accent.solid.hero};
+ background: ${({ theme }) => theme.accent.transparent.hero};
+ border: ${({ theme }) =>
+ `var(--stroke-thicker, 0.1rem) solid ${theme.accent.solid.hero}`};
}
`;
diff --git a/grass-diary/src/styles/CreateDiary/QuillEditor.style.tsx b/grass-diary/src/styles/CreateDiary/QuillEditor.style.tsx
index 7f2479b4..eeb71d0f 100644
--- a/grass-diary/src/styles/CreateDiary/QuillEditor.style.tsx
+++ b/grass-diary/src/styles/CreateDiary/QuillEditor.style.tsx
@@ -1,9 +1,7 @@
import styled from 'styled-components';
-import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
export const Title = styled.p`
- color: ${semantic.light.object.transparent.assistive};
-
${TYPO.body2}
+ color: ${({ theme }) => theme.object.transparent.assistive};
`;
diff --git a/grass-diary/src/styles/DiaryDetail/DiaryDetail.style.tsx b/grass-diary/src/styles/DiaryDetail/DiaryDetail.style.tsx
index 973024d5..cad3e7cb 100644
--- a/grass-diary/src/styles/DiaryDetail/DiaryDetail.style.tsx
+++ b/grass-diary/src/styles/DiaryDetail/DiaryDetail.style.tsx
@@ -1,5 +1,5 @@
import styled from 'styled-components';
-import { semantic } from '@styles/semantic';
+
import { TYPO } from '@styles/typo';
import { INTERACTION } from '@styles/interaction';
@@ -8,32 +8,33 @@ export const Layout = styled.div`
flex-direction: column;
align-items: center;
- background: linear-gradient(180deg, #fff 0%, #f1f1f1 100%);
+ background: ${({ theme }) => theme.bg.solid.subtler};
`;
export const Container = styled.div`
- margin: auto;
- min-height: 100dvh;
- min-height: 100vh;
display: flex;
- padding: var(--gap-4xl, 3rem) var(--gap-9xl, 8.5rem) var(--gap-7xl, 4.5rem)
- var(--gap-9xl, 8.5rem);
flex-direction: column;
align-items: flex-start;
- gap: var(--gap-lg, 1.25rem);
align-self: stretch;
- border-top: var(--stroke-empty, 0rem) solid
- ${semantic.light.border.transparent.alternative};
- border-right: var(--stroke-thin, 0.0625rem) solid
- ${semantic.light.border.transparent.alternative};
- border-bottom: var(--stroke-empty, 0rem) solid
- ${semantic.light.border.transparent.alternative};
- border-left: var(--stroke-thin, 0.0625rem) solid
- ${semantic.light.border.transparent.alternative};
- background: ${semantic.light.bg.solid.subtlest};
-
width: 60rem;
+ min-height: 100vh;
+
+ margin: auto;
+ gap: var(--gap-lg, 1.25rem);
+ padding: var(--gap-4xl, 3rem) var(--gap-9xl, 8.5rem) var(--gap-7xl, 4.5rem)
+ var(--gap-9xl, 8.5rem);
+
+ border-top: ${({ theme }) => `var(--stroke-empty, 0rem) solid
+ ${theme.border.transparent.alternative}`};
+ border-right: ${({ theme }) => `var(--stroke-thin, 0.0625rem) solid
+ ${theme.border.transparent.alternative}`};
+ border-bottom: ${({ theme }) => `var(--stroke-empty, 0rem) solid
+ ${theme.border.transparent.alternative}`};
+ border-left: ${({ theme }) => `var(--stroke-thin, 0.0625rem) solid
+ ${theme.border.transparent.alternative}`};
+
+ background: ${({ theme }) => theme.bg.solid.subtler};
@media screen and (max-width: 60em) {
width: 100%;
@@ -81,8 +82,9 @@ export const TopBox = styled.div`
export const Title = styled.h1`
margin-left: 0.5rem;
+
${TYPO.title1}
- color: ${semantic.light.object.transparent.neutral};
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const WriterBox = styled.div`
@@ -101,12 +103,12 @@ export const ProfileImage = styled.img`
export const NicknameText = styled.p`
${TYPO.label2}
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
`;
export const TimeText = styled.p`
${TYPO.caption3}
- color: ${semantic.light.object.transparent.assistive};
+ color: ${({ theme }) => theme.object.transparent.assistive};
`;
export const PrivateBox = styled.div`
@@ -117,7 +119,7 @@ export const PrivateBox = styled.div`
export const PrivateText = styled.p`
${TYPO.label1}
- color: ${semantic.light.object.transparent.alternative};
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const EmojiBox = styled.div`
@@ -125,10 +127,12 @@ export const EmojiBox = styled.div`
width: 2rem;
height: 2rem;
padding: var(--gap-5xs, 0.125rem);
+
border-radius: var(--radius-round, 6rem);
- border: var(--stroke-thin, 0.0625rem) solid
- ${semantic.light.border.transparent.assistive};
- background: ${semantic.light.fill.transparent.assistive};
+ border: ${({ theme }) => `var(--stroke-thin, 0.0625rem) solid
+ ${theme.border.transparent.assistive}`};
+
+ background: ${({ theme }) => theme.fill.transparent.assistive};
`;
export const EmojiText = styled.p`
@@ -137,10 +141,11 @@ export const EmojiText = styled.p`
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
- color: ${semantic.light.object.transparent.alternative};
- ${TYPO.title2}
font-size: 1.25rem !important;
line-height: 1.375rem !important;
+
+ ${TYPO.title2}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const DiarySection = styled.section`
@@ -164,7 +169,7 @@ export const ContentBox = styled.div`
align-self: stretch;
${TYPO.body2}
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
`;
export const BottomSection = styled.section`
@@ -191,7 +196,7 @@ export const TagList = styled.ul`
flex-wrap: wrap;
`;
-export const TagItem = styled.li`
+export const TagItem = styled.li<{ isDarkMode: boolean }>`
display: flex;
padding: var(--gap-4xs, 0.25rem) var(--gap-xs, 0.625rem);
justify-content: center;
@@ -199,26 +204,35 @@ export const TagItem = styled.li`
gap: var(--gap-4xs, 0.25rem);
border-radius: var(--radius-xs, 0.5rem);
- border: var(--stroke-thin, 0.0625rem) solid
- ${semantic.light.border.transparent.alternative};
- background: ${semantic.light.fill.transparent.assistive};
- ${INTERACTION.default.subtle(semantic.light.fill.transparent.assistive)}
+ border: ${({ theme }) => `var(--stroke-thin, 0.0625rem) solid
+ ${theme.border.transparent.alternative}`};
+
+ background: ${({ theme }) => theme.fill.transparent.assistive};
+
+ ${({ isDarkMode, theme }) => {
+ const fillColor = isDarkMode
+ ? theme.fill.transparent.assistive
+ : theme.fill.transparent.assistive;
+
+ return INTERACTION.default.subtle(fillColor);
+ }}
`;
export const TagText = styled.p`
${TYPO.caption1}
- color: ${semantic.light.object.transparent.alternative};
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const Divider = styled.div`
width: 100%;
height: 0.0625rem;
- background: ${semantic.light.border.transparent.alternative};
+ background: ${({ theme }) => theme.border.transparent.alternative};
`;
export const CommentCountText = styled.p`
- ${TYPO.label3}
align-self: stretch;
- color: ${semantic.light.object.transparent.neutral};
+
+ ${TYPO.label3}
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
diff --git a/grass-diary/src/styles/GlobalStyle.ts b/grass-diary/src/styles/GlobalStyle.ts
index 107e2988..f1f03346 100644
--- a/grass-diary/src/styles/GlobalStyle.ts
+++ b/grass-diary/src/styles/GlobalStyle.ts
@@ -2,7 +2,7 @@ import { createGlobalStyle } from 'styled-components';
import { TYPO } from './typo';
import { semantic } from './semantic';
-export const GlobalStyle = createGlobalStyle`
+export const GlobalStyle = createGlobalStyle<{ isDarkMode: boolean }>`
@font-face {
font-family: 'KoPubWorldDotum';
font-display: swap;
@@ -132,13 +132,13 @@ export const GlobalStyle = createGlobalStyle`
padding-left: 16px;
}
- .ql-toolbar.ql-snow{
+ .ql-toolbar .ql-snow{
border-top-right-radius: 0.75rem;
border-top-left-radius: 0.75rem;
}
- .ql-container.ql-snow{
- background-color:white;
+ .ql-container .ql-snow {
+ background-color: ${semantic.light.bg.solid.normal};
border-bottom-right-radius: 0.75rem;
border-bottom-left-radius: 0.75rem;
}
@@ -147,17 +147,36 @@ export const GlobalStyle = createGlobalStyle`
height: 50vh;
width: 42.5rem;
- color: ${semantic.light.object.solid.hero};
${TYPO.body2}
+ color: ${semantic.light.object.solid.hero};
@media screen and (max-width: 60em) {
- height:36.25em;
- width: 20em;
- gap: 1.5em;
+ height:36.25em;
+ width: 20em;
+ gap: 1.5em;
+ }
+ }
+
+ /* 다크 모드 스타일 */
+ body[data-theme='dark'] .ql-container {
+ background-color: ${semantic.dark.bg.solid.normal};
+ border: 1px solid ${semantic.dark.border.transparent.alternative};
}
+ /* 다크 모드에서 툴바 색상 */
+ body[data-theme='dark'] .ql-toolbar {
+ background-color: ${semantic.dark.bg.solid.normal};
+ border: 1px solid ${semantic.dark.border.transparent.alternative};
}
+ /* 다크 모드에서 버튼 색상 */
+ body[data-theme='dark'] .ql-toolbar .ql-stroke {
+ stroke: #D4D4D4; /* 다크 모드 아이콘 색상 */
+ }
+
+ body[data-theme='dark'] .ql-editor {
+ color: ${semantic.dark.object.solid.hero};
+ }
input {
margin: 0;
diff --git a/grass-diary/src/styles/Intro/IntroStyles.ts b/grass-diary/src/styles/Intro/IntroStyles.ts
index 2f8ac0e4..7292d0e5 100644
--- a/grass-diary/src/styles/Intro/IntroStyles.ts
+++ b/grass-diary/src/styles/Intro/IntroStyles.ts
@@ -1,16 +1,20 @@
+import styled from 'styled-components';
+
import { INTERACTION } from '@styles/interaction';
import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
-import styled from 'styled-components';
-const IntroContainer = styled.main`
+const IntroContainer = styled.main<{ isDarkMode: boolean }>`
display: flex;
flex-direction: column;
align-items: center;
min-width: 20rem;
- background: linear-gradient(180deg, #fff 0%, #ebebeb 100%);
+ background: ${({ isDarkMode }) =>
+ isDarkMode
+ ? 'linear-gradient(180deg, #2B2B2B 0%, #1B1B1B 100%)'
+ : 'linear-gradient(180deg, #fff 0%, #ebebeb 100%)'};
`;
const CommonSection = styled.section`
@@ -71,7 +75,7 @@ const LogoImg = styled.img`
const MainTitle = styled.h2`
${TYPO.display2};
- color: ${semantic.light.object.solid.hero};
+ color: ${({ theme }) => theme.object.solid.hero};
`;
const MainIntrouctionText = styled.small`
@@ -79,7 +83,7 @@ const MainIntrouctionText = styled.small`
text-align: center;
${TYPO.title1}
- color: ${semantic.light.object.transparent.alternative};
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
/** common login button */
@@ -130,17 +134,12 @@ const ScrollMessageContainer = styled.div`
gap: 0.5rem;
`;
-const ScrollText = styled.small`
+const ScrollText = styled.p`
align-self: stretch;
-
text-align: center;
- ${TYPO.label2}
- color: ${semantic.light.object.transparent.alternative};
-`;
-const ScrollImg = styled.img`
- width: 1.25rem;
- height: 1.25rem;
+ ${TYPO.label2}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
/** second section */
@@ -171,14 +170,14 @@ const CommonTitle = styled.h1`
text-align: center;
${TYPO.title3}
- color: ${semantic.light.object.solid.hero};
+ color: ${({ theme }) => theme.object.solid.hero};
`;
const CommonIntroductionText = styled.p`
text-align: center;
${TYPO.label3}
- color: ${semantic.light.object.transparent.alternative};
+ color:${({ theme }) => theme.object.transparent.alternative};
`;
const HighlightText = styled.span`
@@ -248,7 +247,6 @@ export {
ButtonText,
ScrollMessageContainer,
ScrollText,
- ScrollImg,
CommonArticle,
CommonTitleContainer,
CommonTitle,
diff --git a/grass-diary/src/styles/Main/BottomSection.style.tsx b/grass-diary/src/styles/Main/BottomSection.style.tsx
index 07d5ed07..375d52ee 100644
--- a/grass-diary/src/styles/Main/BottomSection.style.tsx
+++ b/grass-diary/src/styles/Main/BottomSection.style.tsx
@@ -1,5 +1,4 @@
import styled from 'styled-components';
-import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
export const Section = styled.div`
@@ -39,12 +38,13 @@ export const Card = styled.div`
flex: 1 0 0;
border-radius: var(--radius-md, 1rem);
- border: var(--stroke-thin, 0.0625rem) solid
- ${semantic.light.border.transparent.assistive};
+ border: ${({ theme }) => `var(--stroke-thin, 0.0625rem) solid
+ ${theme.border.transparent.assistive}`};
- background: ${semantic.light.bg.solid.normal};
+ background: ${({ theme }) => theme.bg.solid.normal};
- box-shadow: 0rem 0rem 0.0625rem 0rem rgba(0, 0, 0, 0.04),
+ box-shadow:
+ 0rem 0rem 0.0625rem 0rem rgba(0, 0, 0, 0.04),
0rem 0.125rem 0.25rem 0rem rgba(0, 0, 0, 0.08);
@media screen and (max-width: 60em) {
@@ -61,7 +61,7 @@ export const Divider = styled.div`
width: 26.75rem;
height: 0.0625rem;
- background: ${semantic.light.border.transparent.alternative};
+ background: ${({ theme }) => theme.border.transparent.alternative};
@media screen and (max-width: 60em) {
width: 16em;
@@ -71,17 +71,15 @@ export const Divider = styled.div`
export const CardText = styled.p`
align-self: stretch;
- color: ${semantic.light.object.transparent.neutral};
-
${TYPO.label3}
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const CardSubText = styled.p`
align-self: stretch;
- color: ${semantic.light.object.transparent.neutral};
-
${TYPO.caption2}
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const Wrap = styled.div`
@@ -100,8 +98,7 @@ export const RewardContainer = styled.div`
export const RewardPointBox = styled.div`
flex: 1 0 0;
-
- color: ${semantic.light.accent.solid.normal};
+ color: ${({ theme }) => theme.accent.solid.normal};
`;
export const ThemeMarketBtn = styled.button`
@@ -112,19 +109,19 @@ export const ThemeMarketBtn = styled.button`
gap: var(--gap-2xs, 0.5rem);
border-radius: var(--radius-xs, 0.5rem);
- border: var(--stroke-thin, 0.0625rem) solid
- ${semantic.light.accent.solid.normal};
+ border: ${({ theme }) =>
+ `var(--stroke-thin, 0.0625rem) solid ${theme.accent.solid.normal}`};
- background: ${semantic.light.accent.transparent.normal};
+ background: ${({ theme }) => theme.accent.transparent.normal};
cursor: pointer;
`;
export const ThemeMarketText = styled.p`
- color: ${semantic.light.accent.solid.hero};
text-align: center;
${TYPO.label2}
+ color: ${({ theme }) => theme.accent.solid.hero};
`;
export const RetrospectContainer = styled.div`
@@ -142,12 +139,12 @@ export const RetrospectBtn = styled.button`
gap: var(--gap-2xs, 0.5rem);
border-radius: var(--radius-xs, 0.5rem);
- background: ${semantic.light.fill.transparent.alternative};
+ background: ${({ theme }) => theme.fill.transparent.alternative};
`;
export const RetrospectText = styled.p`
- color: ${semantic.light.object.transparent.alternative};
text-align: center;
${TYPO.label2}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
diff --git a/grass-diary/src/styles/Main/MiddleSection.style.tsx b/grass-diary/src/styles/Main/MiddleSection.style.tsx
index 2a39ac15..63aafe7f 100644
--- a/grass-diary/src/styles/Main/MiddleSection.style.tsx
+++ b/grass-diary/src/styles/Main/MiddleSection.style.tsx
@@ -1,5 +1,4 @@
import styled from 'styled-components';
-import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
export const Container = styled.div`
@@ -23,17 +22,17 @@ export const GrassLabel = styled.div`
gap: var(--gap-3xs, 0.375rem);
border-radius: var(--radius-sm, 0.75rem);
- border: var(--stroke-thin, 0.0625rem) solid
- ${semantic.light.border.transparent.alternative};
+ border: ${({ theme }) => `var(--stroke-thin, 0.0625rem) solid
+ ${theme.border.transparent.alternative}`};
- background: ${semantic.light.fill.transparent.alternative};
+ background: ${({ theme }) => theme.fill.transparent.alternative};
`;
export const GrassLabelText = styled.p`
- color: ${semantic.light.object.transparent.alternative};
text-align: center;
${TYPO.label2}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const GrassBanner = styled.div`
@@ -46,23 +45,22 @@ export const GrassBanner = styled.div`
export const GrassBannerText = styled.p`
align-self: stretch;
- color: ${semantic.light.object.transparent.alternative};
text-align: center;
${TYPO.title1}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const GrassBannerTextSecond = styled.p`
align-self: stretch;
-
- color: ${semantic.light.object.transparent.alternative};
text-align: center;
${TYPO.label2}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const HighlightedText = styled.span`
- color: ${semantic.light.accent.solid.normal};
+ color: ${({ theme }) => theme.accent.solid.normal};
`;
export const GrassTableBox = styled.div`
@@ -84,10 +82,10 @@ export const DayBox = styled.div`
height: 3.5rem;
border-radius: var(--radius-sm, 0.75rem);
+ background: ${({ theme }) => theme.fill.transparent.assistive};
- background: ${semantic.light.fill.transparent.assistive};
-
- box-shadow: 0rem 0rem 0.0625rem 0rem rgba(0, 0, 0, 0.04),
+ box-shadow:
+ 0rem 0rem 0.0625rem 0rem rgba(0, 0, 0, 0.04),
0rem 0.125rem 0.25rem 0rem rgba(0, 0, 0, 0.08);
@media screen and (max-width: 60em) {
@@ -95,10 +93,10 @@ export const DayBox = styled.div`
height: 2em;
border-radius: var(--radius-sm, 0.75rem);
+ background: ${({ theme }) => theme.fill.transparent.assistive};
- background: ${semantic.light.fill.transparent.assistive};
-
- box-shadow: 0rem 0rem 0.0625rem 0rem rgba(0, 0, 0, 0.04),
+ box-shadow:
+ 0rem 0rem 0.0625rem 0rem rgba(0, 0, 0, 0.04),
0rem 0.125rem 0.25rem 0rem rgba(0, 0, 0, 0.08);
}
`;
diff --git a/grass-diary/src/styles/Main/TopSection.style.tsx b/grass-diary/src/styles/Main/TopSection.style.tsx
index 246ad690..7faa860f 100644
--- a/grass-diary/src/styles/Main/TopSection.style.tsx
+++ b/grass-diary/src/styles/Main/TopSection.style.tsx
@@ -1,5 +1,4 @@
import styled from 'styled-components';
-import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
export const Container = styled.div`
@@ -16,17 +15,17 @@ export const Container = styled.div`
`;
export const TodayDateBox = styled.div`
- color: ${semantic.light.object.transparent.neutral};
text-align: center;
${TYPO.label3}
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const DailyQuestionText = styled.p`
- color: ${semantic.light.object.solid.hero};
text-align: center;
${TYPO.display1}
+ color: ${({ theme }) => theme.object.solid.hero};
@media screen and (max-width: 60em) {
${TYPO.title3}
@@ -41,22 +40,23 @@ export const ButtonContainer = styled.div`
export const CreateDiaryBtn = styled.button`
display: flex;
- padding: 0.75rem 1rem;
- justify-content: center;
align-items: center;
+ justify-content: center;
+
gap: 0.5rem;
+ padding: 0.75rem 1rem;
+ border: none;
border-radius: 0.75rem;
- background: ${semantic.light.accent.solid.normal};
- border: none;
+ background: ${({ theme }) => theme.accent.solid.normal};
`;
export const CreateDiaryText = styled.p`
- color: ${semantic.light.base.solid.white};
text-align: center;
${TYPO.label3}
+ color: ${({ theme }) => theme.base.solid.white};
`;
export const MydiaryBtn = styled.button`
@@ -67,14 +67,15 @@ export const MydiaryBtn = styled.button`
gap: 0.5rem;
border-radius: 0.75rem;
- border: 0.0625rem solid ${semantic.light.border.transparent.alternative};
+ border: ${({ theme }) =>
+ `0.0625rem solid ${theme.border.transparent.alternative}`};
- background: ${semantic.light.bg.solid.normal};
+ background: ${({ theme }) => theme.bg.solid.normal};
`;
export const MydiaryTxt = styled.p`
- color: ${semantic.light.object.transparent.alternative};
text-align: center;
${TYPO.label3}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
diff --git a/grass-diary/src/styles/MyPage/MyStyles.ts b/grass-diary/src/styles/MyPage/MyStyles.ts
index 4e6f0691..d067c912 100644
--- a/grass-diary/src/styles/MyPage/MyStyles.ts
+++ b/grass-diary/src/styles/MyPage/MyStyles.ts
@@ -1,22 +1,19 @@
import styled, { css } from 'styled-components';
import { TYPO } from '@styles/typo';
-import { semantic } from '@styles/semantic';
import { INTERACTION } from '@styles/interaction';
-export const SettingContainer = styled.div`
+export const SettingContainer = styled.div<{ isDarkMode: boolean }>`
display: flex;
flex-direction: column;
align-items: center;
min-width: 20rem;
- background: linear-gradient(
- 180deg,
- rgba(255, 255, 255, 0.3) 0%,
- rgba(241, 241, 241, 0.3) 100%
- ),
- ${semantic.light.bg.solid.subtler};
+ background: ${({ isDarkMode }) =>
+ isDarkMode
+ ? 'linear-gradient(180deg, #2B2B2B 0%, #1B1B1B 100%)'
+ : 'linear-gradient(180deg, #fff 0%, #ebebeb 100%)'};
`;
export const ViewportContainer = styled.div`
@@ -49,14 +46,14 @@ export const UserNameText = styled.span`
text-align: center;
${TYPO.title2};
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
`;
export const UserInfoText = styled.span`
text-align: center;
${TYPO.body2};
- color: ${semantic.light.object.transparent.neutral};
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
/* 잔디 컨테이너 */
@@ -80,15 +77,15 @@ export const GrassYearTagBox = styled.div`
padding: 0.5rem 1rem;
border-radius: 0.75rem;
- border: 1px solid ${semantic.light.border.transparent.alternative};
- background: ${semantic.light.fill.transparent.assistive};
+ border: ${({ theme }) => `1px solid ${theme.border.transparent.alternative}`};
+ background: ${({ theme }) => theme.fill.transparent.assistive};
`;
export const GrassYearText = styled.span`
text-align: center;
${TYPO.label2};
- color: ${semantic.light.object.transparent.alternative};
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const GrassContainer = styled.div`
@@ -162,10 +159,10 @@ export const DateBubbleBox = styled.div`
${TYPO.label1};
text-align: center;
- color: ${semantic.light.inverse.solid.normal};
+ color: ${({ theme }) => theme.inverse.solid.normal};
border-radius: 0.75rem;
- background: ${semantic.light.inverse.solid.bg};
+ background: ${({ theme }) => theme.inverse.solid.bg};
box-shadow:
0px 0px 2px 0px rgba(0, 0, 0, 0.06),
@@ -205,6 +202,7 @@ export const MainSection = styled.section`
position: relative;
max-width: 60rem;
+ min-height: 20.8rem;
padding: 0rem 1.5rem 4.5rem 1.5rem;
`;
@@ -230,8 +228,8 @@ export const SearchBox = styled.div`
padding: 1rem 1.25rem;
border-radius: 1rem;
- border: 1px solid ${semantic.light.border.transparent.alternative};
- background: ${semantic.light.bg.solid.normal};
+ border: ${({ theme }) => `1px solid ${theme.border.transparent.alternative}`};
+ background: ${({ theme }) => theme.bg.solid.normal};
@media screen and (max-width: 60em) {
padding: 0.625rem 1rem;
@@ -250,7 +248,7 @@ export const SearchInput = styled.input`
width: 100%;
${TYPO.body2};
- color: ${semantic.light.object.transparent.assistive};
+ color: ${({ theme }) => theme.object.transparent.assistive};
border: none;
@@ -316,8 +314,8 @@ export const DiaryCardArticle = styled.article`
padding: 1.25rem;
border-radius: 1rem;
- border: 1px solid ${semantic.light.border.transparent.assistive};
- background: ${semantic.light.bg.solid.normal};
+ border: ${({ theme }) => `1px solid ${theme.border.transparent.assistive}`};
+ background: ${({ theme }) => theme.bg.solid.normal};
box-shadow:
0px 0px 1px 0px rgba(0, 0, 0, 0.04),
@@ -345,12 +343,12 @@ export const DiaryCardDateBox = styled.div`
export const DiaryCardDateText = styled.span`
${TYPO.label1};
- color: ${semantic.light.object.transparent.neutral};
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const DiaryCardTimeText = styled.small`
${TYPO.caption1};
- color: ${semantic.light.object.transparent.assistive};
+ color: ${({ theme }) => theme.object.transparent.assistive};
`;
export const DiaryCardMoreBox = styled.div`
@@ -385,7 +383,7 @@ export const DiaryCardText = styled.span`
text-overflow: ellipsis;
${TYPO.body2};
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
`;
export const DiaryCardBottomBox = styled.div`
@@ -417,8 +415,8 @@ export const HashtagBox = styled.div`
padding: 0.25rem 0.625rem;
border-radius: 0.5rem;
- border: 1px solid ${semantic.light.border.transparent.alternative};
- background: ${semantic.light.fill.transparent.assistive};
+ border: ${({ theme }) => `1px solid ${theme.border.transparent.alternative}`};
+ background: ${({ theme }) => theme.fill.transparent.assistive};
`;
export const HashtagImg = styled.img`
@@ -428,7 +426,7 @@ export const HashtagImg = styled.img`
export const HashtagText = styled.span`
${TYPO.caption1};
- color: ${semantic.light.object.transparent.alternative};
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const CommentFavoriteBox = styled.div`
@@ -448,7 +446,7 @@ export const DiaryCardItemBox = styled.div`
export const DiaryCardItemText = styled.span`
${TYPO.label3};
- color: ${semantic.light.object.transparent.assistive};
+ color: ${({ theme }) => theme.object.transparent.assistive};
`;
/* 페이지네이션 컴포넌트 */
@@ -470,17 +468,10 @@ export const PaginationIconButton = styled.button`
border: none;
border-radius: 0.25rem;
+ color: ${({ theme }) => theme.object.solid.normal};
${INTERACTION.default.normal()}
`;
-export const PaginationImg = styled.div<{ $imageURL: string }>`
- width: 1rem;
- height: 1rem;
-
- background-size: cover;
- background: url(${props => props.$imageURL}) no-repeat center center;
-`;
-
/* 사이드 해시태그 목록 컴포넌트 */
export const HashtagAside = styled.aside`
@@ -499,8 +490,8 @@ export const HashtagAside = styled.aside`
gap: 1rem;
border-radius: 1rem;
- border: 1px solid ${semantic.light.border.transparent.assistive};
- background: ${semantic.light.bg.solid.normal};
+ border: ${({ theme }) => `1px solid ${theme.border.transparent.assistive}`};
+ background: ${({ theme }) => theme.bg.solid.normal};
box-shadow:
0px 0px 1px 0px rgba(0, 0, 0, 0.04),
@@ -516,7 +507,7 @@ export const HashtagListText = styled.span`
height: 1.375rem;
${TYPO.label2};
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
`;
export const SideHashtagListBox = styled.ul`
@@ -553,13 +544,13 @@ export const SideHashtagList = styled.li`
export const SideHashtagText = styled.span<{ $variant?: boolean }>`
${TYPO.label1};
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
text-align: center;
${({ $variant }) => {
if ($variant) {
return css`
- color: ${semantic.light.accent.solid.hero};
+ color: ${({ theme }) => theme.accent.solid.hero};
`;
}
}}
@@ -567,5 +558,5 @@ export const SideHashtagText = styled.span<{ $variant?: boolean }>`
export const SideHashtagUsageText = styled.span`
${TYPO.label1};
- color: ${semantic.light.object.transparent.assistive};
+ color: ${({ theme }) => theme.object.transparent.assistive};
`;
diff --git a/grass-diary/src/styles/Setting/SettingStyles.ts b/grass-diary/src/styles/Setting/SettingStyles.ts
index 56ed2381..144bf172 100644
--- a/grass-diary/src/styles/Setting/SettingStyles.ts
+++ b/grass-diary/src/styles/Setting/SettingStyles.ts
@@ -1,5 +1,8 @@
import styled, { css } from 'styled-components';
+import { ReactComponent as DarkTheme } from '@svg/darkTheme.svg';
+import { ReactComponent as LightTheme } from '@svg/lightTheme.svg';
+
import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
import { INTERACTION } from '@styles/interaction';
@@ -12,12 +15,7 @@ const SettingContainer = styled.main`
min-width: 20rem;
gap: 1.5rem;
- background: linear-gradient(
- 180deg,
- rgba(255, 255, 255, 0.3) 0%,
- rgba(241, 241, 241, 0.3) 100%
- ),
- ${semantic.light.bg.solid.subtler};
+ background: ${({ theme }) => theme.bg.solid.subtler};
`;
const ContentContainer = styled.div`
@@ -110,7 +108,7 @@ const UserNameText = styled.span`
text-align: center;
${TYPO.title2}
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
`;
const ProfileButtonBox = styled.div`
@@ -136,13 +134,13 @@ const ImageUploadButton = styled.button`
border-radius: 0.5rem;
- color: ${semantic.light.base.solid.white};
- background: ${semantic.light.accent.solid.normal};
+ background: ${({ theme }) => theme.accent.solid.normal};
+ color: ${({ theme }) => theme.base.solid.white};
- ${INTERACTION.default.normal(semantic.light.accent.solid.normal)}
+ ${INTERACTION.default.normal(semantic.light.accent.solid.normal)};
`;
-const ImageDeleteButton = styled.button`
+const ImageDeleteButton = styled.button<{ isDarkMode: boolean }>`
display: flex;
justify-content: center;
align-items: center;
@@ -155,8 +153,9 @@ const ImageDeleteButton = styled.button`
border-radius: 0.5rem;
- color: ${semantic.light.base.solid.white};
- background: ${semantic.light.object.solid.normal};
+ background: ${({ theme }) => theme.object.solid.normal};
+ color: ${({ theme, isDarkMode }) =>
+ isDarkMode ? theme.base.solid.black : theme.base.solid.white};
${INTERACTION.default.normal(semantic.light.object.solid.normal)}
`;
@@ -206,7 +205,7 @@ const UserIntroductionBox = styled.div<{ isFocused: boolean }>`
box-shadow:
0px 0px 1px 0px rgba(0, 0, 0, 0.04),
0px 2px 4px 0px rgba(0, 0, 0, 0.08);
- background: ${semantic.light.bg.solid.normal};
+ background: ${({ theme }) => theme.bg.solid.normal};
`;
const UserIntroduction = styled.textarea`
@@ -219,10 +218,12 @@ const UserIntroduction = styled.textarea`
resize: none;
outline: none;
- ${TYPO.caption2}
overflow: hidden;
text-overflow: ellipsis;
+
+ ${TYPO.caption2}
color: ${semantic.light.object.transparent.neutral};
+ background: ${({ theme }) => theme.bg.solid.normal};
`;
const IntroductionCountText = styled.span`
@@ -317,12 +318,12 @@ const SettingLabel = styled.label`
width: 7rem;
${TYPO.title1}
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
`;
const SettingText = styled.span`
${TYPO.label2}
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
`;
const AmendButton = styled.button`
@@ -343,7 +344,7 @@ const NicknameInput = styled.input`
border-radius: 0.5rem;
border: 1px solid ${semantic.light.border.transparent.alternative};
- background: #fff;
+ background: ${({ theme }) => theme.bg.solid.normal};
&:focus {
border: 1px solid ${semantic.light.accent.solid.alternative};
@@ -383,7 +384,7 @@ const SettingMessage = styled.span`
align-self: stretch;
${TYPO.caption1};
- color: ${semantic.light.object.transparent.neutral};
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
const DividerLine = styled.div`
@@ -453,11 +454,72 @@ const ThemeSelectBox = styled.div`
gap: 2.5rem 3rem;
`;
-const ThemeImg = styled.img`
- width: 6.5625rem;
- height: 6.5625rem;
+const DarkThemeBox = styled.div<{ isDarkMode: boolean }>`
+ position: relative;
+
+ width: 7.125rem;
+ height: 7.125rem;
+
+ &::after {
+ content: '';
+ position: absolute;
+
+ top: 0.3rem;
+ right: -0.7rem;
+
+ width: 3rem;
+ height: 3rem;
+
+ pointer-events: none;
+
+ background-image: url('../../../public/assets/icons/checkTheme.svg');
+ background-repeat: no-repeat;
+
+ opacity: ${({ isDarkMode }) => (isDarkMode ? 1 : 0)};
+ }
+`;
+
+const LightThemeBox = styled.div<{ isDarkMode: boolean }>`
+ position: relative;
+
+ width: 7.125rem;
+ height: 7.125rem;
+
+ &::after {
+ content: '';
+ position: absolute;
+
+ top: 0.3rem;
+ right: -0.7rem;
+
+ width: 3rem;
+ height: 3rem;
+
+ pointer-events: none;
+
+ background-image: url('../../../public/assets/icons/checkTheme.svg');
+ background-repeat: no-repeat;
+
+ opacity: ${({ isDarkMode }) => (isDarkMode ? 0 : 1)};
+ }
+`;
+
+const DarkThemeImg = styled(DarkTheme)<{ isDarkMode: boolean }>`
+ width: 7.125rem;
+ height: 7.125rem;
+
+ cursor: pointer;
+
+ stroke: ${({ isDarkMode }) => (isDarkMode ? '#00B478' : '#D4D4D4')};
+`;
+
+const LightThemeImg = styled(LightTheme)<{ isDarkMode: boolean }>`
+ width: 7.125rem;
+ height: 7.125rem;
cursor: pointer;
+
+ stroke: ${({ isDarkMode }) => (isDarkMode ? '#D4D4D4' : '#00B478')};
`;
const WithdrawBoxArticle = styled.article`
@@ -574,7 +636,10 @@ export {
ThemeContainer,
ThemeMessageBox,
ThemeSelectBox,
- ThemeImg,
+ DarkThemeBox,
+ LightThemeBox,
+ DarkThemeImg,
+ LightThemeImg,
WithdrawBoxArticle,
WithdrawBox,
WithdrawButton,
diff --git a/grass-diary/src/styles/Share/Share.style.tsx b/grass-diary/src/styles/Share/Share.style.tsx
index de5f5c8b..46e72d8f 100644
--- a/grass-diary/src/styles/Share/Share.style.tsx
+++ b/grass-diary/src/styles/Share/Share.style.tsx
@@ -1,18 +1,17 @@
import styled from 'styled-components';
-import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
export const Layout = styled.div`
min-height: 100vh;
min-height: 100dvh;
- background: ${semantic.light.bg.solid.subtler};
+ background: ${({ theme }) => theme.bg.solid.subtler};
`;
export const Title = styled.h2`
display: none;
@media screen and (max-width: 60em) {
display: block;
- color: ${semantic.light.object.transparent.neutral};
+ color: ${({ theme }) => theme.object.transparent.neutral};
text-align: center;
${TYPO.title1}
}
diff --git a/grass-diary/src/styles/component/Button/BackButton.style.tsx b/grass-diary/src/styles/component/Button/BackButton.style.tsx
index f1a974bb..1fd9300c 100644
--- a/grass-diary/src/styles/component/Button/BackButton.style.tsx
+++ b/grass-diary/src/styles/component/Button/BackButton.style.tsx
@@ -1,16 +1,17 @@
-import { ReactComponent as LeftArrow } from '@svg/chevron_left.svg';
-import { INTERACTION } from '@styles/interaction';
-import { semantic } from '@styles/semantic';
import styled from 'styled-components';
+import { INTERACTION } from '@styles/interaction';
+import { ReactComponent as LeftArrow } from '@svg/chevron_left.svg';
+
export const ArrowButton = styled.button`
display: flex;
padding: var(--gap-4xs, 0.25rem);
border-radius: var(--radius-2xs, 0.25rem);
+
${INTERACTION.default.normal()}
`;
export const ArrowIcon = styled(LeftArrow)`
- fill: ${semantic.light.object.transparent.neutral};
+ fill: ${({ theme }) => theme.object.transparent.neutral};
cursor: pointer;
`;
diff --git a/grass-diary/src/styles/component/Button/Menu.style.tsx b/grass-diary/src/styles/component/Button/Menu.style.tsx
index 842c9a58..1ea23e1a 100644
--- a/grass-diary/src/styles/component/Button/Menu.style.tsx
+++ b/grass-diary/src/styles/component/Button/Menu.style.tsx
@@ -15,7 +15,7 @@ export const MenuBox = styled.div`
export const MenuText = styled.p<{ color?: string }>`
${TYPO.label2};
flex: 1 0 0;
- color: ${props => props.color || semantic.light.object.solid.normal};
+ color: ${props => props.color || props.theme.object.solid.normal};
text-align: left;
`;
diff --git a/grass-diary/src/styles/component/Button/Menus.style.tsx b/grass-diary/src/styles/component/Button/Menus.style.tsx
index 1127cae7..af3b09a1 100644
--- a/grass-diary/src/styles/component/Button/Menus.style.tsx
+++ b/grass-diary/src/styles/component/Button/Menus.style.tsx
@@ -1,5 +1,4 @@
import styled from 'styled-components';
-import { semantic } from '@styles/semantic';
import { INTERACTION } from '@styles/interaction';
export const MenusWrapper = styled.div`
@@ -25,10 +24,12 @@ export const MenusNav = styled.nav<{ $toggle: boolean }>`
align-items: flex-start;
border-radius: var(--radius-md, 1rem);
- background: ${semantic.light.bg.solid.normal};
+ background: ${({ theme }) => theme.bg.solid.normal};
- box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.06),
- 0px 2px 4px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.13);
+ box-shadow:
+ 0px 0px 2px 0px rgba(0, 0, 0, 0.06),
+ 0px 2px 4px 0px rgba(0, 0, 0, 0.06),
+ 0px 4px 8px 0px rgba(0, 0, 0, 0.13);
position: absolute;
top: 0;
diff --git a/grass-diary/src/styles/component/Comment/CommentDisplay.style.tsx b/grass-diary/src/styles/component/Comment/CommentDisplay.style.tsx
index 7e329a25..d3a0f9a2 100644
--- a/grass-diary/src/styles/component/Comment/CommentDisplay.style.tsx
+++ b/grass-diary/src/styles/component/Comment/CommentDisplay.style.tsx
@@ -15,10 +15,10 @@ export const CommentItem = styled.li<{ $isMe: boolean }>`
props.$isMe
? 'none'
: `var(--stroke-thin, 1px) solid
- ${semantic.light.border.transparent.assistive}`};
+ ${props.theme.border.transparent.assistive}`};
background: ${props =>
- props.$isMe ? semantic.light.fill.transparent.assistive : 'none'};
+ props.$isMe ? props.theme.fill.transparent.assistive : 'none'};
`;
export const TopBox = styled.div`
@@ -41,20 +41,20 @@ export const ProfileImage = styled.img`
flex-shrink: 0;
border-radius: var(--radius-empty, 1.5rem);
object-fit: cover;
- background: ${semantic.light.fill.transparent.alternative};
+ background: ${({ theme }) => theme.fill.transparent.alternative};
`;
export const NameText = styled.p<{ $isMe: boolean }>`
${TYPO.label2}
color: ${props =>
props.$isMe
- ? semantic.light.accent.solid.hero
- : semantic.light.object.solid.normal};
+ ? props.theme.accent.solid.hero
+ : props.theme.object.solid.normal};
`;
export const TimeText = styled.p`
${TYPO.caption1}
- color: ${semantic.light.object.transparent.assistive};
+ color: ${({ theme }) => theme.object.transparent.assistive};
`;
export const ContentBox = styled.div<{
@@ -62,11 +62,11 @@ export const ContentBox = styled.div<{
}>`
${TYPO.body1}
${props => props.$isReply && `padding-left: var(--gap-2xl, 2rem);`}
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
white-space: pre;
`;
export const DeletedText = styled.p`
${TYPO.body1}
- color: ${semantic.light.object.transparent.alternative};
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
diff --git a/grass-diary/src/styles/component/Comment/Input.style.tsx b/grass-diary/src/styles/component/Comment/Input.style.tsx
index 0d49a960..31feab8a 100644
--- a/grass-diary/src/styles/component/Comment/Input.style.tsx
+++ b/grass-diary/src/styles/component/Comment/Input.style.tsx
@@ -1,5 +1,4 @@
import styled from 'styled-components';
-import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
export const TopBox = styled.div`
@@ -26,7 +25,7 @@ export const ProfileImage = styled.img`
export const NameText = styled.p`
${TYPO.label2}
- color: ${semantic.light.object.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
`;
export const InputContainer = styled.div<{
@@ -44,8 +43,8 @@ export const InputContainer = styled.div<{
border: var(--stroke-thin, 0.0625rem) solid
${props =>
props.$focus
- ? semantic.light.accent.solid.hero
- : semantic.light.border.transparent.normal};
+ ? props.theme.accent.solid.hero
+ : props.theme.border.transparent.normal};
${props =>
props.$isReply &&
`box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 3px 6px 0px rgba(0, 0, 0, 0.11);`}
@@ -74,15 +73,18 @@ export const Input = styled.textarea`
flex: 1 0 0;
border: none;
+
${TYPO.body1}
- caret-color: ${semantic.light.accent.solid.normal};
+ color: ${({ theme }) => theme.object.solid.normal};
+ caret-color: ${({ theme }) => theme.accent.solid.normal};
&::placeholder,
&::-webkit-input-placeholder {
- color: ${semantic.light.object.transparent.assistive};
+ color: ${({ theme }) => theme.object.transparent.assistive};
}
+
&:-ms-input-placeholder {
- color: ${semantic.light.object.transparent.assistive};
+ color: ${({ theme }) => theme.object.transparent.assistive};
}
`;
@@ -93,7 +95,7 @@ export const CancelButton = styled.button`
text-align: center;
${TYPO.label1}
- color: ${semantic.light.object.transparent.alternative};
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const SubmitButton = styled.button`
@@ -105,9 +107,9 @@ export const SubmitButton = styled.button`
text-align: center;
${TYPO.label1}
- color: ${semantic.light.accent.solid.normal};
+ color: ${({ theme }) => theme.accent.solid.normal};
&:disabled {
- color: ${semantic.light.object.transparent.disabled};
+ color: ${({ theme }) => theme.object.transparent.disabled};
}
`;
diff --git a/grass-diary/src/styles/component/Feed/Feed.style.tsx b/grass-diary/src/styles/component/Feed/Feed.style.tsx
index 4293d7d4..d7dfc28a 100644
--- a/grass-diary/src/styles/component/Feed/Feed.style.tsx
+++ b/grass-diary/src/styles/component/Feed/Feed.style.tsx
@@ -1,6 +1,5 @@
import styled from 'styled-components';
import { TYPO } from '@styles/typo';
-import { semantic } from '@styles/semantic';
export const Article = styled.article`
display: flex;
@@ -20,10 +19,11 @@ export const Container = styled.li<{ $isTop: boolean }>`
margin-bottom: 1rem;
border-radius: var(--radius-md, 1rem);
- border: var(--stroke-thin, 0.0625rem) solid
- ${semantic.light.border.transparent.assistive};
- background: ${semantic.light.bg.solid.normal};
- box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
+ border: ${({ theme }) => `var(--stroke-thin, 0.0625rem) solid
+ ${theme.border.transparent.assistive}`};
+ background: ${({ theme }) => theme.bg.solid.normal};
+ box-shadow:
+ 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
0px 2px 4px 0px rgba(0, 0, 0, 0.08);
@media screen and (max-width: 60em) {
@@ -44,7 +44,7 @@ export const UserImage = styled.img`
height: 2.5rem;
border-radius: var(--radius-empty, 2.5rem);
- background: ${semantic.light.fill.transparent.alternative};
+ background: ${({ theme }) => theme.fill.transparent.alternative};
object-fit: cover;
`;
@@ -58,15 +58,13 @@ export const TextBox = styled.div`
`;
export const TimeText = styled.p`
- color: ${semantic.light.object.transparent.assistive};
-
${TYPO.caption1}
+ color: ${({ theme }) => theme.object.transparent.assistive};
`;
export const DateText = styled.div`
- color: ${semantic.light.object.transparent.neutral};
-
${TYPO.label1}
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const NameBox = styled.div`
@@ -74,8 +72,8 @@ export const NameBox = styled.div`
align-items: center;
gap: var(--gap-2xs, 0.5rem);
- color: ${semantic.light.object.transparent.neutral};
${TYPO.label1}
+ color: ${({ theme }) => theme.object.transparent.neutral};
`;
export const EmojiBox = styled.div`
@@ -86,10 +84,10 @@ export const EmojiBox = styled.div`
align-items: center;
border-radius: var(--radius-round, 6rem);
- border: var(--stroke-thin, 0.0625rem) solid
- ${semantic.light.border.transparent.assistive};
+ border: ${({ theme }) => `var(--stroke-thin, 0.0625rem) solid
+ ${theme.border.transparent.assistive}`};
- background: ${semantic.light.fill.transparent.assistive};
+ background: ${({ theme }) => theme.fill.transparent.assistive};
`;
export const BottomBox = styled.div`
@@ -109,9 +107,10 @@ export const ContentText = styled.div<{ $isTop: boolean; $hasImage: boolean }>`
align-self: stretch;
word-break: break-all;
- color: ${semantic.light.object.solid.normal};
- ${TYPO.body2}
overflow: hidden;
+
+ ${TYPO.body2}
+ color: ${({ theme }) => theme.object.solid.normal};
`;
export const Image = styled.img<{ $isTop: boolean }>`
@@ -134,6 +133,7 @@ export const IconBox = styled.div`
padding: var(--gap-5xs, 0.125rem) var(--gap-empty, 0rem);
align-items: center;
gap: var(--gap-2xs, 0.5rem);
- color: ${semantic.light.object.transparent.assistive};
+
${TYPO.label3}
+ color: ${({ theme }) => theme.object.transparent.assistive};
`;
diff --git a/grass-diary/src/styles/component/Feed/Popular.style.tsx b/grass-diary/src/styles/component/Feed/Popular.style.tsx
index c0e70b80..11eafd52 100644
--- a/grass-diary/src/styles/component/Feed/Popular.style.tsx
+++ b/grass-diary/src/styles/component/Feed/Popular.style.tsx
@@ -1,6 +1,5 @@
import styled from 'styled-components';
import { TYPO } from '@styles/typo';
-import { semantic } from '@styles/semantic';
import Slider from 'react-slick';
export const SeeMoreContainer = styled.div`
@@ -14,10 +13,10 @@ export const SeeMoreContainer = styled.div`
`;
export const SeeMoreButton = styled.button`
- color: ${semantic.light.object.transparent.alternative};
text-align: center;
${TYPO.label2}
+ color: ${({ theme }) => theme.object.transparent.alternative};
`;
export const FeedBox = styled.div`
@@ -59,11 +58,11 @@ export const SliderBox = styled.div`
width: 12px;
height: 12px;
border-radius: 6px;
- background: ${semantic.light.fill.transparent.normal};
+ background: ${({ theme }) => theme.fill.transparent.normal};
}
.slick-dots .slick-active button {
- background: ${semantic.light.accent.solid.normal};
+ background: ${({ theme }) => theme.accent.solid.normal};
}
`;
@@ -88,7 +87,7 @@ export const RankSection = styled.section`
gap: var(--gap-2xl, 2rem);
align-self: stretch;
overflow: hidden;
- background: ${semantic.light.fill.transparent.alternative};
+ background: ${({ theme }) => theme.fill.transparent.alternative};
@media screen and (max-width: 60em) {
min-width: 20em;
@@ -102,7 +101,7 @@ export const RankText = styled.span`
flex-direction: column;
gap: var(--gap-md, 1rem);
- color: ${semantic.light.object.transparent.neutral};
+ color: ${({ theme }) => theme.object.transparent.neutral};
text-align: center;
${TYPO.title2}
diff --git a/grass-diary/src/styles/component/Layout/Header.style.tsx b/grass-diary/src/styles/component/Layout/Header.style.tsx
index 4b021d7f..633881a8 100644
--- a/grass-diary/src/styles/component/Layout/Header.style.tsx
+++ b/grass-diary/src/styles/component/Layout/Header.style.tsx
@@ -11,12 +11,12 @@ export const FeedButton = styled.button`
justify-content: center;
align-items: center;
border-radius: var(--radius-xs, 0.5rem);
- color: ${semantic.light.object.solid.normal};
text-align: center;
white-space: nowrap;
- ${TYPO.title1}
+ ${TYPO.title1}
${INTERACTION.default.normal()}
+ color: ${({ theme }) => theme.object.solid.normal};
`;
export const Header = styled.header`
@@ -27,9 +27,9 @@ export const Header = styled.header`
justify-content: center;
align-items: center;
- border-bottom: var(--stroke-thin, 1px) solid
- ${semantic.light.border.transparent.alternative};
- background: ${semantic.light.bg.solid.subtlest};
+ border-bottom: ${({ theme }) => `var(--stroke-thin, 1px) solid
+ ${theme.border.transparent.alternative}`};
+ background: ${({ theme }) => theme.bg.solid.subtlest};
@media screen and (max-width: 60em) {
min-width: 20em;
@@ -66,7 +66,7 @@ export const LogoImage = styled.img`
export const LogoIcon = styled(LogoSVG)`
width: 4.47663rem;
height: 1.125rem;
- fill: ${semantic.light.object.solid.normal};
+ fill: ${({ theme }) => theme.object.solid.normal};
`;
export const MenuBarBox = styled.div`
@@ -82,10 +82,11 @@ export const LoginButton = styled.button`
justify-content: center;
align-items: center;
+ white-space: nowrap;
gap: var(--gap-2xs, 0.5rem);
- color: ${semantic.light.base.solid.white};
border-radius: var(--radius-xs, 0.5rem);
- background: ${semantic.light.accent.solid.normal};
- white-space: nowrap;
+
+ color: ${({ theme }) => theme.base.solid.white};
+ background: ${({ theme }) => theme.accent.solid.normal};
${INTERACTION.default.normal(semantic.light.accent.solid.normal)}
`;
diff --git a/grass-diary/src/styles/component/Like/Like.style.tsx b/grass-diary/src/styles/component/Like/Like.style.tsx
index 68ef5a49..cfe33896 100644
--- a/grass-diary/src/styles/component/Like/Like.style.tsx
+++ b/grass-diary/src/styles/component/Like/Like.style.tsx
@@ -1,5 +1,4 @@
import styled from 'styled-components';
-import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
import { ReactComponent as LikeBorder } from '@svg/favorite_border.svg';
import { ReactComponent as LikeIcon } from '@svg/favorite.svg';
@@ -17,23 +16,23 @@ export const LikeContainer = styled.button<{ $isPushed: boolean }>`
border: var(--stroke-thin, 0.0625rem) solid
${props =>
props.$isPushed
- ? semantic.light.accent.solid.normal
- : semantic.light.border.transparent.alternative};
+ ? props.theme.accent.solid.normal
+ : props.theme.border.transparent.alternative};
background: ${props =>
props.$isPushed
- ? semantic.light.accent.transparent.normal
- : semantic.light.bg.solid.normal};
+ ? props.theme.accent.transparent.normal
+ : props.theme.bg.solid.normal};
color: ${props =>
props.$isPushed
- ? semantic.light.accent.solid.hero
- : semantic.light.object.transparent.alternative};
+ ? props.theme.accent.solid.hero
+ : props.theme.object.transparent.alternative};
${props =>
props.$isPushed
- ? INTERACTION.default.normal(semantic.light.accent.transparent.normal)
- : INTERACTION.default.normal(semantic.light.bg.solid.normal)}
+ ? INTERACTION.default.normal(props.theme.accent.transparent.normal)
+ : INTERACTION.default.normal(props.theme.bg.solid.normal)}
`;
export const CountText = styled.p`
@@ -43,7 +42,7 @@ export const CountText = styled.p`
export const YES = styled(LikeIcon)`
cursor: pointer;
- fill: ${semantic.light.accent.solid.hero};
+ fill: ${({ theme }) => theme.accent.solid.hero};
`;
export const No = styled(LikeBorder)`
diff --git a/grass-diary/src/styles/component/Notification/Callout.style.tsx b/grass-diary/src/styles/component/Notification/Callout.style.tsx
index 25878214..0cb0590d 100644
--- a/grass-diary/src/styles/component/Notification/Callout.style.tsx
+++ b/grass-diary/src/styles/component/Notification/Callout.style.tsx
@@ -1,5 +1,4 @@
import styled from 'styled-components';
-import { semantic } from '@styles/semantic';
import { TYPO } from '@styles/typo';
export const Container = styled.div`
@@ -10,16 +9,15 @@ export const Container = styled.div`
gap: var(--gap-2xs, 0.5rem);
border-radius: var(--radius-xs, 0.5rem);
- border: var(--stroke-thin, 0.0625rem) solid
- ${semantic.light.border.transparent.alternative};
+ border: ${({ theme }) => `var(--stroke-thin, 0.0625rem) solid
+ ${theme.border.transparent.alternative}`};
- background: ${semantic.light.fill.transparent.assistive};
+ background: ${({ theme }) => theme.fill.transparent.assistive};
`;
export const Text = styled.p`
- color: ${semantic.light.object.transparent.alternative};
-
${TYPO.caption2}
+ color: ${({ theme }) => theme.object.transparent.alternative};
@media screen and (max-width: 60em) {
${TYPO.caption1}
diff --git a/grass-diary/src/styles/semantic.ts b/grass-diary/src/styles/semantic.ts
index 215af460..018f362d 100644
--- a/grass-diary/src/styles/semantic.ts
+++ b/grass-diary/src/styles/semantic.ts
@@ -115,7 +115,7 @@ export const semantic = {
inverse: {
solid: {
accent: '#00A66E' as HexColor,
- negative: '#F17961' as HexColor,
+ negative: '#D93526' as HexColor,
hero: '#ffffff' as HexColor,
normal: '#E2E2E2' as HexColor,
bg: '#2B2B2B' as HexColor,