Skip to content

Commit

Permalink
Merge pull request #28 from SCBJ-7/feature/#27-create-global-style-th…
Browse files Browse the repository at this point in the history
…eme-files

[#27] GlobalStyle & Theme 외부 파일 생성
  • Loading branch information
dbstjrals authored Jan 3, 2024
2 parents 58b0cd0 + a34610c commit 1d78030
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
43 changes: 3 additions & 40 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,13 @@ import ReactDOM from "react-dom/client";
import "./index.css";
import { RouterProvider } from "react-router-dom";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

import { theme } from "./styles/theme.ts";
import { GlobalStyle } from "./styles/globalStyle.ts";
import { router } from "./routes/router";
import "./index.css";
import { ThemeProvider, createGlobalStyle } from "styled-components";
import { ThemeProvider } from "styled-components";

const queryClient = new QueryClient();

export const GlobalStyle = createGlobalStyle`
/* css reset */
*{margin:0;padding:0;font:inherit;color:inherit;}
*, :after, :before {box-sizing:border-box;}
:root {-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;text-size-adjust:100%;cursor:default;line-height:1.5;overflow-wrap:break-word;word-break:break-word;tab-size:4;}
html, body, #root {height:100%;}
img, svg {display: block;max-width:100%;}
button {background:none;border:0;cursor:pointer;}
a {text-decoration:none}
* {
box-sizing: border-box;
font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}
`;

const theme = {
color: {
primaryLight: "#FFECDB",
primary: "#FF7C17",
primaryDark: "#CB5A04",

secondaryLight: "#CDEDFF",
secondary: "#519EC9",
secondaryDark: "#0072B1",

black: "#151515",

greyScale1: "#404040",
greyScale2: "#686868",
greyScale3: "#999999",
greyScale4: "#B8B8B8",
greyScale5: "#CDCDCD",
greyScale6: "#E9E9E9",
},
};

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
Expand Down
17 changes: 17 additions & 0 deletions src/styles/globalStyle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { createGlobalStyle } from "styled-components";

export const GlobalStyle = createGlobalStyle`
/* css reset */
*{margin:0;padding:0;font:inherit;color:inherit;}
*, :after, :before {box-sizing:border-box;}
:root {-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;text-size-adjust:100%;cursor:default;line-height:1.5;overflow-wrap:break-word;word-break:break-word;tab-size:4;}
html, body, #root {height:100%;}
img, svg {display: block;max-width:100%;}
button {background:none;border:0;cursor:pointer;}
a {text-decoration:none}
* {
box-sizing: border-box;
font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}
`;
20 changes: 20 additions & 0 deletions src/styles/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const theme = {
color: {
primaryLight: "#FFECDB",
primary: "#FF7C17",
primaryDark: "#CB5A04",

secondaryLight: "#CDEDFF",
secondary: "#519EC9",
secondaryDark: "#0072B1",

black: "#151515",

greyScale1: "#404040",
greyScale2: "#686868",
greyScale3: "#999999",
greyScale4: "#B8B8B8",
greyScale5: "#CDCDCD",
greyScale6: "#E9E9E9",
},
};

0 comments on commit 1d78030

Please sign in to comment.