Skip to content
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
44 changes: 44 additions & 0 deletions packages/common/src/styles/GlobalStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'use client';

import { Global, css } from '@emotion/react';
import emotionReset from 'emotion-reset';
import { theme } from './theme';

export function GlobalStyle() {
return (
<Global
styles={css`
${emotionReset}

html {
@media ${theme.breakPoint['600']} {
font-size: 0.75rem;
}

@media (max-width: 400px) {
font-size: 0.625rem;
}
}

body {
overscroll-behavior-y: none;
overflow-x: hidden;
}

body,
* {
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;
box-sizing: border-box;
}

a {
text-decoration: none;
color: inherit;
}
`}
/>
);
}
3 changes: 2 additions & 1 deletion packages/common/src/styles/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./theme";
export * from './theme';
export * from './GlobalStyle';
19 changes: 11 additions & 8 deletions projects/admin/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import "./globals.css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import './globals.css';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';

import Providers from "./providers";
import { GlobalStyle } from 'common';

const inter = Inter({ subsets: ["latin"] });
import Providers from './providers';

const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: 'Create Next App',
description: 'Generated by create next app',
};

export default function RootLayout({
Expand All @@ -17,7 +19,8 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<html lang="ko">
<html lang='ko'>
<GlobalStyle />
<Providers>
<body className={inter.className}>{children}</body>
</Providers>
Expand Down
3 changes: 3 additions & 0 deletions projects/client/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Inter } from 'next/font/google';

import Providers from './providers';

import { GlobalStyle } from 'common';

const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
Expand All @@ -18,6 +20,7 @@ export default function RootLayout({
}) {
return (
<html lang='ko'>
<GlobalStyle />
<Providers>
<body className={inter.className}>{children}</body>
</Providers>
Expand Down
25 changes: 13 additions & 12 deletions projects/storybook/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import type { Preview } from "@storybook/react";
import { ThemeProvider } from "@emotion/react";
import { theme } from "common";
import React from "react";
import Providers from "./providers";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import type { Preview } from '@storybook/react';
import { ThemeProvider } from '@emotion/react';
import { GlobalStyle, theme } from 'common';
import React from 'react';
import Providers from './providers';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
backgrounds: {
default: "light",
default: 'light',
values: [
{
name: "light",
value: "#ffffff",
name: 'light',
value: '#ffffff',
},
{
name: "dark",
value: "#050505",
name: 'dark',
value: '#050505',
},
],
},
Expand All @@ -34,6 +34,7 @@ const preview: Preview = {
decorators: [
(Story) => (
<ThemeProvider theme={theme}>
<GlobalStyle />
<Providers>
<ReactQueryDevtools />
<Story />
Expand Down