Skip to content

Commit

Permalink
style: emotion theme 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
ljh0608 committed Jan 4, 2024
1 parent bd7336e commit 5e1ccf7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import React from 'react';

import { ThemeProvider } from '@emotion/react';
import ReactDOM from 'react-dom/client';

import App from './App.tsx';
import { theme } from './styles/theme.ts';

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
<ThemeProvider theme={theme}>
<App />
</ThemeProvider>
</React.StrictMode>,
);
13 changes: 13 additions & 0 deletions src/styles/emotion.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import '@emotion/react';

type colors = 'primary' | 'positive' | 'negative';

declare module '@emotion/react' {
export interface Theme {
colors: {
primary: string;
positive: string;
negative: string;
};
}
}
7 changes: 7 additions & 0 deletions src/styles/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const theme = {
colors: {
primary: 'hotpink',
positive: 'green',
negative: 'red',
},
};

0 comments on commit 5e1ccf7

Please sign in to comment.