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

[송규경] Chore/Design: Design System 세팅 및 Nested CSS warning 해결 #15

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

Ssong-Q
Copy link
Collaborator

@Ssong-Q Ssong-Q commented Jan 25, 2024

📖 작업 내용

  • Nested CSS warning 해결

Error log

Nested CSS was detected, but CSS nesting has not been configured correctly. Please enable a CSS nesting plugin *before* Tailwind in your configuration. See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting

해결 방법

withastro/astro#6202

  1. @tailwindcss/nesting 다운로드 후
  2. 아래와 같이 postcss.config.js 수정
module.exports = {
  plugins: {
    'tailwindcss/nesting': {},
    tailwindcss: {},
    autoprefixer: {},
  },
};
  • Design System 세팅 완료

Color

image

Font

const notoSansKr = Noto_Sans_KR({
  preload: false,
  weight: ['100', '200', '300', '400', '500', '600', '700', '800', '900'],
});

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="ko">
      <body className={notoSansKr.className}>
        <ReactQueryProviders>{children}</ReactQueryProviders>
      </body>
    </html>
  );

✅ PR 포인트

Issue close #11

📸 스크린샷

image image

@Ssong-Q Ssong-Q added ⚙ chore build와 관련된 부분, 패키지 매니저 설정 등 여러가지 production code와 무관한 부분! 말 그대로 자질구레한 일! 🎨 style 코드 스타일 수정 및 css, UI 관련 코드 추가, 수정 ✏ fix 기능 버그 및 기존 코드 수정 labels Jan 25, 2024
@Ssong-Q Ssong-Q self-assigned this Jan 25, 2024
Copy link

vercel bot commented Jan 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
youth-frontend ✅ Ready (Inspect) Visit Preview Jan 25, 2024 5:28am

@Ssong-Q Ssong-Q linked an issue Jan 25, 2024 that may be closed by this pull request
1 task
@@ -1,5 +1,6 @@
module.exports = {
plugins: {
'tailwindcss/nesting': {},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning 해결 포인트입니다

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 클래스명이 아니라 css 파일 내에서 nesting(중첩) 문법을 사용할 때 쓰일 때 필요한 요소로 보이는데 맞나요?!

테일윈드에서 nesting 문법으로 @apply을 보통 이용하지 않나요?!

Comment on lines +6 to +10
// Noto sans 폰트 적용
const notoSansKr = Noto_Sans_KR({
preload: false,
weight: ['100', '200', '300', '400', '500', '600', '700', '800', '900'],
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notoSansKr의 경우, preload false 값으로 불러옵니다.

md: '0.375rem',
lg: '0.5rem',
sm: '0.5rem', // 추후 수정 가능
md: '1.5rem', // 추후 수정 가능
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figma design system 기본 값을 md 설정했어요

Comment on lines +42 to +51
DEFAULT: 'var(--primary-400)',
1: 'var(--primary-50)',
2: 'var(--primary-100)',
3: 'var(--primary-200)',
4: 'var(--primary-300)',
5: 'var(--primary-500)',
6: 'var(--primary-600)',
7: 'var(--primary-700)',
8: 'var(--primary-800)',
9: 'var(--primary-900)',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Primary Color
DEFAULT의 경우 아래와 같이,

className="text-primary"

다른건 아래와 같이,

className="text-primary-4"

Comment on lines +73 to +81
1: 'var(--gray-50)',
2: 'var(--gray-100)',
3: 'var(--gray-200)',
4: 'var(--gray-300)',
5: 'var(--gray-400)',
6: 'var(--gray-500)',
7: 'var(--gray-600)',
8: 'var(--gray-700)',
9: 'var(--gray-800)',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gray Color
아래와 같이,

className="bg-gray-9"

Copy link
Collaborator

@BeMatthewsong BeMatthewsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍🏻 고생하셨습니다!

@@ -1,5 +1,6 @@
module.exports = {
plugins: {
'tailwindcss/nesting': {},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 클래스명이 아니라 css 파일 내에서 nesting(중첩) 문법을 사용할 때 쓰일 때 필요한 요소로 보이는데 맞나요?!

테일윈드에서 nesting 문법으로 @apply을 보통 이용하지 않나요?!

@@ -17,7 +20,7 @@ export default function RootLayout({
}>) {
return (
<html lang="ko">
<body className={inter.className}>
<body className={notoSansKr.className}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 레이아웃에 폰트에 관련한 클래스를 넣은 이유가 있을까요?!

글로벌 css에 넣으면 안 되는 건가 싶어서요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

google font를 import 해서 가장 최상단 root Layout에서 감싸주려고 했어요

Comment on lines -147 to -227

@font-face {
font-family: "Pretendard";
font-weight: 900;
font-display: swap;
src: local("Pretendard Black"),
url("/fonts/Pretendard-Black.subset.woff2") format("woff2"),
url("/fonts/Pretendard-Black.subset.woff") format("woff");
}

@font-face {
font-family: "Pretendard";
font-weight: 800;
font-display: swap;
src: local("Pretendard ExtraBold"),
url("/fonts/Pretendard-ExtraBold.subset.woff2") format("woff2"),
url("/fonts/Pretendard-ExtraBold.subset.woff") format("woff");
}

@font-face {
font-family: "Pretendard";
font-weight: 700;
font-display: swap;
src: local("Pretendard Bold"),
url("/fonts/Pretendard-Bold.subset.woff2") format("woff2"),
url("/fonts/Pretendard-Bold.subset.woff") format("woff");
}

@font-face {
font-family: "Pretendard";
font-weight: 600;
font-display: swap;
src: local("Pretendard SemiBold"),
url("/fonts/Pretendard-SemiBold.subset.woff2") format("woff2"),
url("/fonts/Pretendard-SemiBold.subset.woff") format("woff");
}

@font-face {
font-family: "Pretendard";
font-weight: 500;
font-display: swap;
src: local("Pretendard Medium"),
url("/fonts/Pretendard-Medium.subset.woff2") format("woff2"),
url("/fonts/Pretendard-Medium.subset.woff") format("woff");
}

@font-face {
font-family: "Pretendard";
font-weight: 400;
font-display: swap;
src: local("Pretendard Regular"),
url("/fonts/Pretendard-Regular.subset.woff2") format("woff2"),
url("/fonts/Pretendard-Regular.subset.woff") format("woff");
}

@font-face {
font-family: "Pretendard";
font-weight: 300;
font-display: swap;
src: local("Pretendard Light"),
url("/fonts/Pretendard-Light.subset.woff2") format("woff2"),
url("/fonts/Pretendard-Light.subset.woff") format("woff");
}

@font-face {
font-family: "Pretendard";
font-weight: 200;
font-display: swap;
src: local("Pretendard ExtraLight"),
url("/fonts/Pretendard-ExtraLight.subset.woff2") format("woff2"),
url("/fonts/Pretendard-ExtraLight.subset.woff") format("woff");
}

@font-face {
font-family: "Pretendard";
font-weight: 100;
font-display: swap;
src: local("Pretendard Thin"),
url("/fonts/Pretendard-Thin.subset.woff2") format("woff2"),
url("/fonts/Pretendard-Thin.subset.woff") format("woff");
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헉 엄청나게 코드를 줄이셨네요 👍🏻

@Ssong-Q Ssong-Q merged commit 6beb387 into dev Jan 25, 2024
4 checks passed
@Ssong-Q Ssong-Q deleted the chore/design-system branch January 25, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙ chore build와 관련된 부분, 패키지 매니저 설정 등 여러가지 production code와 무관한 부분! 말 그대로 자질구레한 일! ✏ fix 기능 버그 및 기존 코드 수정 🎨 style 코드 스타일 수정 및 css, UI 관련 코드 추가, 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚩 Design System 세팅하기
3 participants