Skip to content

Commit

Permalink
chore: 중복되는 global style 파일 하나로 합치기
Browse files Browse the repository at this point in the history
  • Loading branch information
ZUITOPIA committed Nov 18, 2024
1 parent 23ea2bf commit a523b11
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 129 deletions.
102 changes: 0 additions & 102 deletions src/global-style.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
import GlobalStyle from "./global-style";
import GlobalStyle from "../src/style/global-style";

createRoot(document.getElementById("root")!).render(
<StrictMode>
Expand Down
32 changes: 21 additions & 11 deletions src/style/global-style.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
import { createGlobalStyle } from 'styled-components';
import theme from './theme';
import './normalize.css';
import './fonts.css';
import { createGlobalStyle } from "styled-components";
import theme from "./theme";
import "./normalize.css";
import "./fonts.css";

const GlobalStyle = createGlobalStyle`
:root {
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';
width: 100%;
height: 100%;
color: ${theme.colors.black100};
background-color: ${theme.colors.white};
background-color: ${theme.colors.gray100};
}
* {
box-sizing: border-box;
scrollbar-width: none;
-ms-overflow-style: none;
font-family: inherit;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand All @@ -31,11 +28,24 @@ const GlobalStyle = createGlobalStyle`
box-sizing: border-box !important;
}
html,
body {
html{
margin: 0;
padding: 0;
padding: 0;
border: 0;
display: flex;
justify-content: center;
}
body {
width: 100%;
height: 100%;
padding: 0 25px;
overscroll-behavior: none;
background-color: ${theme.colors.white};
max-width: ${theme.size.maxWidth};
min-width: ${theme.size.minWidth};
margin: 0;
display: flex;
justify-content: center;
}
a {
Expand Down
30 changes: 15 additions & 15 deletions src/style/normalize.css
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ select {
*/

button,
[type='button'],
[type='reset'],
[type='submit'] {
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}

Expand All @@ -208,9 +208,9 @@ button,
*/

button::-moz-focus-inner,
[type='button']::-moz-focus-inner,
[type='reset']::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
Expand All @@ -220,9 +220,9 @@ button::-moz-focus-inner,
*/

button:-moz-focusring,
[type='button']:-moz-focusring,
[type='reset']:-moz-focusring,
[type='submit']:-moz-focusring {
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}

Expand Down Expand Up @@ -271,8 +271,8 @@ textarea {
* 2. Remove the padding in IE 10.
*/

[type='checkbox'],
[type='radio'] {
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
Expand All @@ -281,8 +281,8 @@ textarea {
* Correct the cursor style of increment and decrement buttons in Chrome.
*/

[type='number']::-webkit-inner-spin-button,
[type='number']::-webkit-outer-spin-button {
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}

Expand All @@ -291,7 +291,7 @@ textarea {
* 2. Correct the outline style in Safari.
*/

[type='search'] {
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
Expand All @@ -300,7 +300,7 @@ textarea {
* Remove the inner padding in Chrome and Safari on macOS.
*/

[type='search']::-webkit-search-decoration {
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}

Expand Down

0 comments on commit a523b11

Please sign in to comment.