Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE] client 디렉토리 reset, 전역 스타일 GlobalStyle을 사용하는 것으로 변경 #173

Merged
merged 3 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,030 changes: 510 additions & 520 deletions client/package-lock.json

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"css-loader": "^7.1.2",
"dotenv": "^16.4.5",
"eslint": "^9.6.0",
"eslint-import-resolver-typescript": "^3.6.1",
Expand All @@ -35,7 +34,6 @@
"html-webpack-plugin": "^5.6.0",
"modify-source-webpack-plugin": "^4.1.0",
"prettier": "3.3.2",
"style-loader": "^4.0.0",
"ts-loader": "^9.5.1",
"typescript": "^5.5.3",
"typescript-eslint": "^7.16.0",
Expand All @@ -56,4 +54,4 @@
"npm": ">=10.7.0",
"node": ">=20.15.1"
}
}
}
6 changes: 5 additions & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import {HDesignProvider} from 'haengdong-design';
import {Outlet} from 'react-router-dom';
import {HDesignProvider} from 'haengdong-design';
import {Global} from '@emotion/react';

import {GlobalStyle} from './GlobalStyle';

const App: React.FC = () => {
return (
<HDesignProvider>
<Global styles={GlobalStyle} />
<Outlet />
</HDesignProvider>
);
Expand Down
157 changes: 157 additions & 0 deletions client/src/GlobalStyle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
import {css} from '@emotion/react';

// reset css -> index css
export const GlobalStyle = css`
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
vertical-align: baseline;
margin: 0;
border: 0;
padding: 0;
font-size: 100%;
font: inherit;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
button {
cursor: pointer;
border: none;
background-color: transparent;
}
* {
box-sizing: border-box;
}

body {
max-width: 768px;
height: 100lvh;
margin: 0 auto;

overflow-y: scroll;
&::-webkit-scrollbar {
display: none;
}
}

section {
width: 100%;
}

#root {
display: flex;
flex-direction: column;
height: 100%;
}
`;
20 changes: 0 additions & 20 deletions client/src/index.css

This file was deleted.

2 changes: 0 additions & 2 deletions client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import ReactDOM from 'react-dom/client';
import {RouterProvider} from 'react-router-dom';

import router from './router';
import './reset.css';
import './index.css';

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
Expand Down
136 changes: 0 additions & 136 deletions client/src/reset.css

This file was deleted.

4 changes: 0 additions & 4 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ export default {
loader: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.svg$/,
use: [
Expand Down
Loading