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

refactor(swc): swc 지원 위해 @emotion/css 제거 #145

Merged
merged 1 commit into from
Jul 6, 2022
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
Binary file modified .yarn/install-state.gz
Binary file not shown.
11 changes: 6 additions & 5 deletions src/components/Container/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { css } from '@emotion/react';
import { HTMLAttributes } from 'react';
import { isMatchedSM } from '../../utils/mediaQuery';
interface ContainerProps extends HTMLAttributes<HTMLDivElement> {
Expand All @@ -9,11 +10,11 @@ export function Container({ children, fluid = false, ...props }: ContainerProps)

return (
<div
css={{
width: '100%',
maxWidth,
margin: '0 auto',
}}
css={css`
width: 100%;
max-width: ${maxWidth};
margin: 0 auto;
`}
{...props}
>
{children}
Expand Down
13 changes: 7 additions & 6 deletions src/components/Flex/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { css } from '@emotion/react';
import { CSSProperties, ElementType, forwardRef, PropsWithRef, Ref } from 'react';
import { OverridableProps } from '../../types/OverridableProps';

Expand Down Expand Up @@ -26,12 +27,12 @@ const Flex = <T extends ElementType = 'div'>(
return (
<Component
ref={ref}
css={{
display: 'flex',
flexDirection: direction,
alignItems: align,
justifyContent: justify,
}}
css={css`
display: flex;
flex-direction: ${direction};
align-items: ${align};
justify-content: ${justify};
`}
{...rest}
>
{children}
Expand Down
19 changes: 10 additions & 9 deletions src/components/Grid/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ElementType, Ref, forwardRef } from 'react';
import { DEFAULT_ELEMENT } from './types';
import { OverridableProps } from '../../types/OverridableProps';
import { gridGutter } from './constants';
import { css } from '@emotion/react';

type BaseAlign = 'flex-start' | 'center' | 'flex-end';
interface RowBaseProps {
Expand All @@ -26,15 +27,15 @@ const Row = <T extends ElementType = typeof DEFAULT_ELEMENT>(
return (
<Component
ref={ref}
css={{
display: 'flex',
flexDirection: direction,
justifyContent: justify,
alignItems: alignItems,
margin: `0 ${gridGutter / 2}px`,
flexWrap: 'wrap',
boxSizing: 'border-box',
}}
css={css`
display: flex;
flex-direction: ${direction};
justify-content: ${justify};
align-items: ${alignItems};
margin: 0 ${gridGutter} 2px;
flex-wrap: wrap;
box-sizing: 'border-box';
`}
{...props}
/>
);
Expand Down
13 changes: 8 additions & 5 deletions src/components/Skeleton/Circle.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { css } from '@emotion/react';
import { CombineElementProps } from '../../types/utils';

type Props = Omit<
Expand All @@ -16,11 +17,13 @@ const Circle = ({ width, height, backgroundStyle, style, ...rest }: Props) => {
return (
<div
css={{
display: 'inline-block',
width: `${width}px`,
height: `${height}px`,
background: backgroundStyle,
borderRadius: '50%',
...css`
display: inline-block;
width: ${width}px;
height: ${height}px;
background: ${backgroundStyle};
border-radius: '50%';
`,
...style,
}}
role="img"
Expand Down
11 changes: 7 additions & 4 deletions src/components/Skeleton/Rect.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { css } from '@emotion/react';
import { CombineElementProps } from '../../types/utils';

type Props = Omit<
Expand All @@ -16,10 +17,12 @@ const Rect = ({ width, height, backgroundStyle, style, ...rest }: Props) => {
return (
<div
css={{
display: 'inline-block',
width: `${width}px`,
height: `${height}px`,
background: backgroundStyle,
...css`
display: inline-block;
width: ${width}px;
height: ${height}px;
background: ${backgroundStyle};
`,
...style,
}}
role="img"
Expand Down
12 changes: 7 additions & 5 deletions src/components/Spacing/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { css } from '@emotion/react';

interface Props {
size: number;
}
export const Spacing = ({ size }: Props) => {
return (
<div
css={{
width: 0,
display: 'block',
height: size,
}}
css={css`
width: 0;
display: 'block';
height: ${size};
`}
/>
);
};
17 changes: 9 additions & 8 deletions src/components/Text/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { css } from '@emotion/react';
import { CSSProperties } from '@emotion/react/node_modules/@emotion/serialize';
import { ElementType, Ref, forwardRef } from 'react';
import { OverridableProps } from '../../types/OverridableProps';
Expand All @@ -24,14 +25,14 @@ const Text = <T extends ElementType = typeof DEFAULT_ELEMENT>(
<Component
ref={ref}
role="text"
css={{
display,
fontWeight: weight,
lineHeight,
fontSize: size,
color,
textAlign: align,
}}
css={css`
display: ${display};
font-weight: ${weight};
line-height: ${lineHeight};
font-size: ${size};
color: ${color};
text-align: ${align};
`}
{...props}
>
{children}
Expand Down
12 changes: 7 additions & 5 deletions src/stories/Components/Flex/Components.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { css } from '@emotion/react';

export function Box({ color }: { color: string }) {
return (
<div
css={{
width: 100,
height: 100,
backgroundColor: color,
}}
css={css`
width: 100%;
height: 100%;
background-color: ${color};
`}
/>
);
}
12 changes: 7 additions & 5 deletions src/stories/Components/Spacing/Components.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { css } from '@emotion/react';

export function Box({ color }: { color: string }) {
return (
<div
css={{
width: 100,
height: 100,
backgroundColor: color,
}}
css={css`
width: 100;
height: 100;
background-color: ${color};
`}
/>
);
}
12 changes: 7 additions & 5 deletions src/stories/Components/Stack/Components.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { css } from '@emotion/react';

export function Box({ color }: { color: string }) {
return (
<div
css={{
width: 100,
height: 100,
backgroundColor: color,
}}
css={css`
width: 100;
height: 100;
background-color: ${color};
`}
/>
);
}