Skip to content

๐Ÿ›fix : Tailwind ์ ์šฉ ์˜ค๋ฅ˜ ๋ฐ ํ† ํฐ ์žฌ์„ค์ •#24

Merged
KongMezu merged 10 commits intodevelopfrom
fix/#23/Stlye-error
Oct 16, 2025
Merged

๐Ÿ›fix : Tailwind ์ ์šฉ ์˜ค๋ฅ˜ ๋ฐ ํ† ํฐ ์žฌ์„ค์ •#24
KongMezu merged 10 commits intodevelopfrom
fix/#23/Stlye-error

Conversation

@KongMezu
Copy link
Contributor

@KongMezu KongMezu commented Oct 16, 2025

๐Ÿ”ฅ ์ž‘์—… ๋‚ด์šฉ

  • Tailwind ์ ์šฉ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ
  • ์ปฌ๋Ÿฌ ํ† ํฐ ์žฌ์„ค์ •

๐Ÿ”—ย ์ด์Šˆ

PR Point (To Reviewer)

Tailwind ์˜ค๋ฅ˜(Next.js 15 + Tailwind v4 ์„ค์ •๋ฌธ์ œ)

์„ธํŒ…์—๋งŒ ์˜ค๋ฅ˜๊ฐ€ ๋ช‡ ๋ฒˆ์ธ์ง€, ํฐํŠธ์ ์šฉ์€ ๋˜๋Š”๋ฐ ๊ธฐ๋ณธ Tailwind ์Šคํƒ€์ผ ์ž์ฒด๊ฐ€ ์ ์šฉ์ด ์•ˆ๋œ๋‹ค ํ•ด์„œ ํ•ด๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค.
์›์ธ์€ Next.js 15 + Tailwind v4์—์„œ config.js ์™€ ๊ฐ™์ด ๋นŒ๋“œํ•˜๋ฉด ์ถฉ๋Œ์ด ๋‚˜ ์ ์šฉ์ด ์•ˆ๋œ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค...
๊ทธ๋ž˜์„œ ์ฟจํ•˜๊ฒŒ ์‚ญ์ œํ•˜๊ณ  ๋Œ€์‹  global.css ์•ˆ์— ์œ ํ‹ธ๋ฆฌํ‹ฐ๋กœ ๋„ฃ์–ด๋†จ์Šต๋‹ˆ๋‹ค. ๋ฌธ์ œ์˜ config๋Š” ์‚ฌ์šฉ ์•ˆํ•˜๊ณ  ์ปฌ๋Ÿฌ ํ† ํฐ๋„ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค(ํฐํŠธ๋ž‘ ๋™์ผ)

  • PostCSS ์„ค์ •์ด ํ•„์š”ํ•ด ๋‹ค์‹œ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค. Next.js ์—์„œ๋Š” ์„ค์ • ์•ˆํ•ด์ฃผ๋ฉด
    Tailwind ํด๋ž˜์Šค๋Š” JSX/HTML์—์„œ๋Š” ๋‚จ์•„ ์žˆ์ง€๋งŒ.. ๋ธŒ๋ผ์šฐ์ €์— ์ „๋‹ฌ๋˜๋Š” CSS์—๋Š” ํฌํ•จ๋˜์ง€ ์•Š๋Š” ํ˜„์ƒ์ด ๋‚˜ํƒ€๋‚˜์„œ Tailwind ์ ์šฉ์ด ์•ˆ๋œ๋“ฏ ํ•ฉ๋‹ˆ๋‹ค.

์—ฌ๋‹ด : ๋” ์ด์ƒ ์„ธํŒ…ํ•˜๊ณ  ์‹ถ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๐Ÿ“ธย ํ”ผ๊ทธ๋งˆ ์Šคํฌ๋ฆฐ์ƒท or ๊ธฐ๋Šฅ GIF

์ ์šฉ์ฝ”๋“œ

export default function HomePage() {
  return (
    <div className='bg-mint-500 text-background p-8 '>
      <h1 className='p-20 text-headline-lg-serif'>ํ…Œ์ŠคํŠธ</h1>
      <p className='text-pink-400 text-display-lg'>๋˜๊ฑฐ๋ผ</p>
    </div>
  );
}

image

Summary by CodeRabbit

  • Chores

    • Added PostCSS and autoprefixer as development dependencies.
    • Created PostCSS configuration for Tailwind CSS integration.
    • Refactored stylesheet imports.
  • Refactor

    • Updated styling system with custom color palette (mint, pink, gray, blue, red).
    • Introduced new layout and grid utility classes.
    • Enhanced CSS reset and typography utilities.
    • Removed legacy Tailwind configuration in favor of PostCSS-based approach.

@vercel
Copy link

vercel bot commented Oct 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
af-fe Ready Ready Preview Comment Oct 16, 2025 7:52am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 16, 2025

Important

Review skipped

Review was skipped due to path filters

โ›” Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR restructures the Tailwind CSS setup by introducing a PostCSS configuration, removing the Tailwind config file, and migrating utility classes and CSS variables directly into the global stylesheet. It updates the import path in the app entry point accordingly.

Changes

Cohort / File(s) Summary
PostCSS & Build Configuration
package.json, postcss.config.js
Added autoprefixer and postcss as dev dependencies. Created new PostCSS config file with Tailwind CSS and autoprefixer plugins.
Tailwind Configuration Removal
tailwind.config.js
Entire file content deleted, removing exported Tailwind configuration object including theme extensions, color tokens, and display mappings.
Global Stylesheet Refactor
src/styles/globals.css
Replaced Tailwind directives with direct @import and custom CSS reset. Added extensive utility classes for colors (mint, pink, gray, blue, red), layout (flex/grid), display, and sizing tokens; introduced CSS variable-based utilities in layered structure.
Import Path Update
src/pages/_app.tsx
Changed globals.css import from absolute alias (@/styles/globals.css) to relative path (../styles/globals.css).

Estimated code review effort

๐ŸŽฏ 3 (Moderate) | โฑ๏ธ ~20 minutes

The PR involves heterogeneous changes across multiple file types: configuration additions, significant CSS restructuring with many new utility class definitions, a complete config file deletion, and a minor import path adjustment. While individual utility class additions follow a repetitive pattern, the overall scope spans structural changes to the build pipeline and stylesheet organization.

Possibly related PRs

Suggested labels

setting

Suggested reviewers

  • jjangminii
  • skyblue1232

Poem

๐Ÿฐ A config once sprawling, now condensed and neat,
PostCSS clicks in place, the pipeline's complete!
Colors bloom in layers, tokens dance in CSS,
Tailwind takes a back seatโ€”globals.css takes this!
โœจ

Pre-merge checks and finishing touches

โŒ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check โš ๏ธ Warning Beyond fixing the Tailwind build error, the PR introduces extensive color token reconfigurations and new utility class definitions in globals.css that fall outside issue #23โ€™s stated scope. Please isolate the color token updates and large utility additions into a separate follow-up PR so this change set remains focused on resolving the Tailwind application error.
Description Check โš ๏ธ Warning The description covers the key work items, linked issue, review points, and includes example code and a screenshot, but omits the required โ€œ๐Ÿค” ์ถ”ํ›„ ์ž‘์—… ์‚ฌํ•ญโ€ section and deviates from the templateโ€™s bullet format under โ€œPR Point.โ€ Please add the missing โ€œ๐Ÿค” ์ถ”ํ›„ ์ž‘์—… ์‚ฌํ•ญโ€ section and format the โ€œPR Pointโ€ section as a bullet list to match the repositoryโ€™s template.
โœ… Passed checks (3 passed)
Check name Status Explanation
Title Check โœ… Passed The title accurately summarizes the principal changesโ€”resolving the Tailwind application error and resetting color tokensโ€”and directly reflects the diff.
Linked Issues Check โœ… Passed The PR removes the conflicting Tailwind config, reintegrates PostCSS for Next.js 15 + Tailwind v4, and demonstrates working utility classes, fully satisfying issue #23โ€™s coding objectives.
Docstring Coverage โœ… Passed No functions found in the changes. Docstring coverage check skipped.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

๐Ÿงน Nitpick comments (2)
src/styles/globals.css (1)

82-164: Consider leveraging Tailwind v4's automatic utility generation.

Manually defining utility classes for every color variant creates significant maintenance overhead. Tailwind v4 can automatically generate utilities from CSS custom properties defined in :root when you use the @theme directive instead of manually creating utility classes.

Consider this alternative approach that reduces code and maintenance:

-@layer utilities {
-  /* Mint */
-  .bg-mint-50 { background-color: var(--mint-50); }
-  .bg-mint-100 { background-color: var(--mint-100); }
-  ... (all manual utility definitions)
-}
+@theme {
+  --color-mint-50: #D9FAFB;
+  --color-mint-100: #B2F4F6;
+  ... (define colors using Tailwind's theme convention)
+}

With @theme, Tailwind v4 will automatically generate bg-mint-50, text-mint-50, etc., without manual class definitions. This approach:

  • Eliminates ~80 lines of repetitive code
  • Automatically generates all standard Tailwind variants (hover, focus, etc.)
  • Reduces maintenance burden when adding/changing colors

Reference: Tailwind CSS v4 theme configuration

src/pages/_app.tsx (1)

1-1: Consider using absolute import path for consistency.

The import path was changed from absolute (@/styles/globals.css) to relative (../styles/globals.css). Next.js projects typically favor absolute imports using the @/ alias for better maintainability and consistency, as relative paths become fragile when files are reorganized.

Consider reverting to the absolute import:

-import '../styles/globals.css';
+import '@/styles/globals.css';

This assumes the @/ alias is configured in tsconfig.json (which is standard in Next.js projects).

๐Ÿ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 18cce38 and bc4a83d.

โ›” Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
๐Ÿ“’ Files selected for processing (6)
  • package.json (1 hunks)
  • postcss.config.js (1 hunks)
  • src/pages/_app.tsx (1 hunks)
  • src/pages/index.tsx (1 hunks)
  • src/styles/globals.css (3 hunks)
  • tailwind.config.js (0 hunks)
๐Ÿ’ค Files with no reviewable changes (1)
  • tailwind.config.js
๐Ÿ”‡ Additional comments (7)
package.json (1)

24-27: LGTM! Dependencies align with Tailwind v4 setup.

The addition of autoprefixer and postcss as dev dependencies correctly supports the new PostCSS-based Tailwind configuration introduced in postcss.config.js.

postcss.config.js (1)

1-6: LGTM! Standard Tailwind v4 PostCSS configuration.

This configuration correctly integrates Tailwind CSS v4 with Next.js 15 using the @tailwindcss/postcss plugin and autoprefixer.

src/styles/globals.css (3)

1-14: LGTM! Correct Tailwind v4 import and base typography.

The @import "tailwindcss" directive is the correct approach for Tailwind v4, and the base typography settings establish proper font sizing and family defaults.


16-73: LGTM! Well-organized CSS custom properties.

The color tokens, font families, and layout properties are clearly organized with Korean comments for maintainability.


166-202: LGTM! Typography and layout utilities are well-defined.

The custom typography utilities for Pretendard and ZEN Serif fonts, along with the display/grid utilities, are correctly implemented and provide good developer ergonomics.

src/pages/_app.tsx (1)

2-2: Quote style updated to single quotes.

Import statement now uses single quotes consistently with common ESLint/Prettier configurations.

src/pages/index.tsx (1)

1-8: LGTM! Appropriate test content for Tailwind validation.

The simplified component serves as an effective test case to verify the Tailwind v4 setup. The classes used (bg-mint-500, text-background, text-headline-lg-serif, text-pink-400, text-display-lg) demonstrate the custom utilities defined in globals.css are being applied correctly.

Note: Ensure text-pink-400 works as expected after addressing the undefined CSS variable issues in globals.css.

jjangminii
jjangminii previously approved these changes Oct 16, 2025
Copy link
Contributor

@jjangminii jjangminii left a comment

Choose a reason for hiding this comment

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

ํ…Œ์ผ์œˆ๋“œ ์ฐธ ์–ด๋ ต๋„ค์š”.. ์ด์ œ ์ง„์งœ ๋˜๊ธธ ๋ฐ”๋ผ๋ฉฐ ๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค-!
์ถ”๊ฐ€์ ์œผ๋กœ ๊ถ๊ธˆํ•œ๊ฑฐ ์ฝ”๋ฉ˜ํŠธ ๋‚จ๊ฒจ๋’€์Šต๋‹ˆ๋‹ค ํ™•์ธํ•ด์ฃผ์„ธ์š”

@@ -1,5 +1,5 @@
import "@/styles/globals.css";
import type { AppProps } from "next/app";
import '../styles/globals.css';
Copy link
Contributor

Choose a reason for hiding this comment

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

์ด๊ฑด ์™œ ์ƒ๋Œ€๊ฒฝ๋กœ๋กœ ๋ฐ”๊พธ์—ˆ๋‚˜์š”?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

์ˆ˜์ •ํ•ด์„œ ์˜ฌ๋ ค๋’€์Šต๋‹ˆ๋‹ค.... ์˜๋„ํ•œ๊ฑด ์•„๋‹ˆ๊ณ  ๊ฒฝ๋กœ ๋ฌธ์ œ๋ผ ์ƒ๊ฐํ–ˆ์„ ๋•Œ ์ •์‹ ์—†์ด ๋ฐ”๊ฟจ์Šต๋‹ˆ๋‹ค.

/* ์ƒ‰์ƒ */
@layer utilities {
/* Mint */
.bg-mint-50 { background-color: var(--mint-50); }
Copy link
Contributor

Choose a reason for hiding this comment

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

์ด๊ฑด ์ง„์งœ ๊ทธ๋ƒฅ ๊ถ๊ธˆํ•ด์„œ ๋ฌผ์–ด๋ณด๋Š”๊ฑด๋ฐ . ์€ ์™œ ๋ถ™์ด๋Š”๊ฑด๊ฐ€์š”?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://tailwindcss.com/docs/styling-with-utility-classes?utm_source=chatgpt.com

๊ณต์‹๋ฌธ์„œ ๋งจ ๋ฐ‘์— ๋ณด์‹œ๋ฉด ์œ ํ‹ธ๋ฆฌํ‹ฐ ํด๋ž˜์Šค๋กœ ์ ์šฉ์‹œ์—๋Š”
.(ํด๋ž˜์Šค ๋ช…์‹œ) ํ•˜๊ณ  ์จ์•ผ ํ•˜๋”๋ผ๊ณ ์š”
์•„๋งˆ .์„ ๋นผ๋ฉด CSS์—์„œ๋Š” bg-mint-50์ด๋ผ๋Š” ํด๋ž˜์Šค๊ฐ€ ์•„๋‹ˆ๋ผ ํƒœ๊ทธ ์ด๋ฆ„์œผ๋กœ ์ธ์‹๋˜๋Š”๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

๐Ÿงน Nitpick comments (4)
src/styles/globals.css (4)

2-2: Consider selfโ€‘hosting Pretendard instead of loading from CDN at runtime.

Reduces thirdโ€‘party dependency, avoids potential CSP/network issues, and improves privacy/cache control.


11-14: 62.5% root font-size may impact accessibility.

Using 62.5% can interfere with user scaling preferences. Consider keeping 100% and sizing via rems, or document rationale.


66-81: Tokens without utilities: add missing helpers or remove tokens to reduce drift.

--display-block, --display-inline, and --grid-rows-auto have no public utilities. Either expose them or drop unused tokens.

 @layer utilities {
 
   .layout-flex { display: var(--display-flex); }
   .layout-grid { display: var(--display-grid); }
+  .layout-block { display: var(--display-block); }
+  .layout-inline { display: var(--display-inline); }
 
   .grid-cols-6 { grid-template-columns: var(--grid-cols-6); }
   .grid-cols-4 { grid-template-columns: var(--grid-cols-4); }
+  .grid-rows-auto { grid-template-rows: var(--grid-rows-auto); }
 
   .max-w-mobile { max-width: var(--max-w-mobile); }
   .min-w-100 { min-width: var(--min-w-100); }
 }

Also applies to: 199-210


83-88: Optional: Declare color-scheme for better UA theming.

Adding color-scheme: light dark; helps native form controls match your light/dark backgrounds.

 @media (prefers-color-scheme: dark) {
   :root {
     --background: #0a0a0a;
     --foreground: #ededed;
+    color-scheme: dark;
   }
 }

And optionally at root for light:

 :root {
   /* โ€ฆexisting varsโ€ฆ */
+  color-scheme: light;
 }
๐Ÿ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between bc4a83d and 2dfdc41.

๐Ÿ“’ Files selected for processing (1)
  • src/styles/globals.css (3 hunks)
๐Ÿ”‡ Additional comments (1)
src/styles/globals.css (1)

89-172: Color utilities look consistent; prior undefined variable issues are resolved.

Full 50โ€“900 ranges exist for mint/pink/gray; mappings are correct.

Confirm that overriding Tailwind core selectors (e.g., bg-pink-500, grid-cols-6) via @layer utilities is intentional for branding, as these will supersede Tailwindโ€™s defaults where both are generated.

Comment on lines 4 to 9
@font-face {
font-family: 'ZEN Serif';
src: url('/fonts/ZEN-SERIF-TTF-Regular.woff2') format('woff2');
font-style: normal;
font-display: swap;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

๐Ÿ› ๏ธ Refactor suggestion | ๐ŸŸ  Major

โ“ Verification inconclusive

Define font-weight for 'ZEN Serif' to match utilities (avoid fallback/synthetic rendering).

Your serif classes use font-weight: 200, but the @font-face omits a weight descriptor, which defaults to 400. Browsers may synthesize or fallback. Declare the correct weight (or a range if variable).

 @font-face {
   font-family: 'ZEN Serif';
   src: url('/fonts/ZEN-SERIF-TTF-Regular.woff2') format('woff2');
-  font-style: normal;
+  font-style: normal;
+  /* If this is a single-weight file used for your serif utilities: */
+  font-weight: 200;
+  /* If it's a variable font, prefer a range, e.g.: */
+  /* font-weight: 200 700; */
   font-display: swap;
 }

Please confirm the actual weight(s) in the font file and set accordingly.


**Specify font-weight in @font-face for โ€˜ZEN Serifโ€™.**

Your โ€œRegularโ€ font file defaults to weight 400; without a weight descriptor, browsers assume 400 and may synthesize. Add `font-weight: 400;` (or a range if this is a variable font) to ensure proper rendering.

```diff
 @font-face {
   font-family: 'ZEN Serif';
   src: url('/fonts/ZEN-SERIF-TTF-Regular.woff2') format('woff2');
   font-style: normal;
+  font-weight: 400;
   font-display: swap;
 }

Confirm the actual font weight(s) in the file and adjust accordingly.

๐Ÿค– Prompt for AI Agents
In src/styles/globals.css around lines 4 to 9, the @font-face for 'ZEN Serif'
omits a font-weight descriptor which can cause browsers to synthesize weights;
add the correct font-weight (e.g. font-weight: 400;) or a weight range if this
is a variable font to match the actual font file, and verify the font file's
declared weight(s) and update the CSS accordingly.

@github-actions github-actions bot added the comment ํ•„์š”ํ•œ ์ฃผ์„ ์ถ”๊ฐ€ ๋ฐ ๋ณ€๊ฒฝ label Oct 16, 2025
@github-actions github-actions bot added fix ๋ฒ„๊ทธ ๋ฐ ์ž์ž˜ํ•œ ์˜ค๋ฅ˜ ์ˆ˜์ • style ์ฝ”๋“œ ์Šคํƒ€์ผ ๋ณ€๊ฒฝ(๊ธฐ๋Šฅ ๋ณ€๊ฒฝ ์—†์Œ) labels Oct 16, 2025
@github-actions
Copy link

๐Ÿท๏ธ Labeler has automatically applied labels based on your PR title, branch name, or commit message.
Please verify that they are correct before merging.

@KongMezu KongMezu merged commit de2d329 into develop Oct 16, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comment ํ•„์š”ํ•œ ์ฃผ์„ ์ถ”๊ฐ€ ๋ฐ ๋ณ€๊ฒฝ fix ๋ฒ„๊ทธ ๋ฐ ์ž์ž˜ํ•œ ์˜ค๋ฅ˜ ์ˆ˜์ • style ์ฝ”๋“œ ์Šคํƒ€์ผ ๋ณ€๊ฒฝ(๊ธฐ๋Šฅ ๋ณ€๊ฒฝ ์—†์Œ)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[settig&fix] Tailwind ์ ์šฉ ์˜ค๋ฅ˜

2 participants