Skip to content

fix(wds): content badge 사이즈별 스타일 수정#531

Open
dididoeun wants to merge 1 commit intomainfrom
fix/content-badge
Open

fix(wds): content badge 사이즈별 스타일 수정#531
dididoeun wants to merge 1 commit intomainfrom
fix/content-badge

Conversation

@dididoeun
Copy link
Copy Markdown
Collaborator

@dididoeun dididoeun commented Apr 7, 2026

Summary

  • xsmall: 아이콘 크기 12px 추가
  • small: border-radius 6px→8px, gap 3px→4px, 아이콘 크기 14px 추가
  • medium: border-radius 8px→10px, 아이콘 크기 14px 추가
  • docs: Sizes 데모에 아이콘 포함 예제 추가

Test plan

  • docs dev 서버에서 ContentBadge Sizes 섹션의 각 사이즈별 border-radius, gap, 아이콘 크기 확인
  • 다른 사이즈/variant에 영향 없는지 확인

🤖 Generated with Claude Code

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • ContentBadge 컴포넌트에서 아이콘을 지원합니다.
  • 스타일

    • 배지의 시각적 요소를 개선했습니다. (경계선 반경, 간격, 아이콘 크기 조정)

- xsmall: 아이콘 크기 12px 추가
- small: border-radius 6px→8px, gap 3px→4px, 아이콘 크기 14px 추가
- medium: border-radius 8px→10px, 아이콘 크기 14px 추가
- docs: Sizes 데모에 아이콘 포함 예제 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

Walkthrough

ContentBadge 컴포넌트의 데모 문서를 업데이트하여 leadingContent prop을 통한 아이콘 추가를 보여주고, 해당 스타일 모듈에서 border-radius, gap, SVG 크기 규칙을 조정했습니다.

Changes

Cohort / File(s) Summary
ContentBadge 데모
docs/data/components/contents/content-badge/web.mdx
Sizes 데모에 leadingContent={<IconPlusThick />} prop을 추가하여 배지 내 아이콘 표시를 구현하고 필요한 import 추가.
ContentBadge 스타일링
packages/wds/src/components/content-badge/style.ts
getSizeStyle 함수에서 각 크기별 border-radius (medium: 8px→10px, small: 6px→8px) 및 gap (small: 3px→4px) 조정, 그리고 SVG 아이콘 크기 규칙 추가 (medium/small: 14px×14px, xsmall: 12px×12px).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경 사항의 주요 내용을 명확하게 설명하고 있습니다. 'content badge 사이즈별 스타일 수정'이라는 제목은 ContentBadge 컴포넌트의 크기별 스타일 조정이라는 핵심 변경 사항을 정확히 반영합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/content-badge

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

size-limit report 📦

Path Size
wds 2.37 KB (0%)
wds-icon 5 KB (0%)
wds-lottie 83 B (0%)
wds-theme 144 B (0%)
wds-engine 332 B (0%)
wds-nextjs 165 B (0%)

Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/wds/src/components/content-badge/style.ts`:
- Around line 37-39: In packages/wds/src/components/content-badge/style.ts
replace the hardcoded pixel values for border-radius, padding, gap and icon
sizes in the ContentBadge style definitions with theme tokens from wds-theme
(use the theme’s radius, spacing and icon/size tokens) so the values at the
shown locations (border-radius: 10px; padding: 7px 8px; gap: 4px; and the other
hardcoded sizes at the other groups) are derived from theme tokens; import the
theme or token helpers used across other components and swap the literal px
values for the appropriate token references (e.g., theme.radius.* /
theme.spacing.* / theme.iconSize.*) in the style.ts definitions for the content
badge.
- Around line 42-45: The current descendant selectors that force all inner svg
sizes in the ContentBadge styles are too broad and override explicitly sized
icons; update the selectors that target svg inside the badge (including
leadingContent/trailingContent rules) to only affect SVGs that do not already
declare dimensions, e.g. change targets to svg:not([width]):not([height]) (and
optionally also exclude inline style width/height with
:not([style*="width"]):not([style*="height"])), or narrow the selector to a
dedicated icon class (e.g. .content-badge__icon > svg) so only intended icons
are resized and existing explicit sizes are preserved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6543b350-6beb-4964-a86a-3ba45f58c3cc

📥 Commits

Reviewing files that changed from the base of the PR and between 391818a and 617c55d.

📒 Files selected for processing (2)
  • docs/data/components/contents/content-badge/web.mdx
  • packages/wds/src/components/content-badge/style.ts

Comment on lines +37 to 39
border-radius: 10px;
padding: 7px 8px;
gap: 4px;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

style.ts의 고정 px 값은 theme token으로 치환해 주세요.

Line 3739, 4344, 4951, 5556, 67~68에서 radius/gap/icon size를 하드코딩하고 있습니다. 이 파일은 토큰 기반으로 관리해야 스케일 변경 시 일관성을 유지할 수 있습니다.

As per coding guidelines **/components/*/style.ts: Define style functions in style.ts using theme tokens from wds-theme.

Also applies to: 43-44, 49-51, 55-56, 67-68

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wds/src/components/content-badge/style.ts` around lines 37 - 39, In
packages/wds/src/components/content-badge/style.ts replace the hardcoded pixel
values for border-radius, padding, gap and icon sizes in the ContentBadge style
definitions with theme tokens from wds-theme (use the theme’s radius, spacing
and icon/size tokens) so the values at the shown locations (border-radius: 10px;
padding: 7px 8px; gap: 4px; and the other hardcoded sizes at the other groups)
are derived from theme tokens; import the theme or token helpers used across
other components and swap the literal px values for the appropriate token
references (e.g., theme.radius.* / theme.spacing.* / theme.iconSize.*) in the
style.ts definitions for the content badge.

Comment on lines +42 to +45
svg {
width: 14px;
height: 14px;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

배지 내부 모든 SVG 크기 강제는 기존 사용처를 깨뜨릴 수 있습니다.

Line 42, Line 54, Line 66의 svg descendant selector는 leadingContent/trailingContent로 들어오는 모든 SVG를 일괄 리사이즈합니다. 기존에 명시 크기를 준 아이콘까지 덮어써서 회귀가 날 수 있으니, 명시 크기 SVG는 제외하거나 더 좁은 타깃으로 제한해 주세요.

🔧 제안 수정안
-        svg {
+        svg:not([width]):not([height]) {
           width: 14px;
           height: 14px;
         }
@@
-        svg {
+        svg:not([width]):not([height]) {
           width: 14px;
           height: 14px;
         }
@@
-        svg {
+        svg:not([width]):not([height]) {
           width: 12px;
           height: 12px;
         }

Also applies to: 54-57, 66-69

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/wds/src/components/content-badge/style.ts` around lines 42 - 45, The
current descendant selectors that force all inner svg sizes in the ContentBadge
styles are too broad and override explicitly sized icons; update the selectors
that target svg inside the badge (including leadingContent/trailingContent
rules) to only affect SVGs that do not already declare dimensions, e.g. change
targets to svg:not([width]):not([height]) (and optionally also exclude inline
style width/height with :not([style*="width"]):not([style*="height"])), or
narrow the selector to a dedicated icon class (e.g. .content-badge__icon > svg)
so only intended icons are resized and existing explicit sizes are preserved.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🚀 Preview

Last commit2588b33
Preview URLhttps://dev-montage.wanted.co.kr/2588b33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant