03. ์ํ โ Figma to Code
์ํ 1: Tailwind (JSX) ๋ณํ
Figma ์ ๋ ฅ
โข
Card ๋
ธ๋ (Auto Layout, padding 24, gap 16)
โข
Avatar (์ํ ์ด๋ฏธ์ง) + Title (ํ
์คํธ) + Description (ํ
์คํธ)
ํ๋ฌ๊ทธ์ธ ์ถ๋ ฅ (Tailwind JSX)
<div className="inline-flex flex-col items-start justify-start gap-4 p-6 bg-white rounded-xl">
<img className="w-12 h-12 rounded-full" src="..." />
<div className="flex flex-col gap-1">
<div className="text-base font-bold text-gray-900">User Name</div>
<div className="text-sm text-gray-500">user@example.com</div>
</div>
</div>
JavaScript
๋ณต์ฌ
๊ฒฐ์ ์ ๋ณํ์ด๋ผ ์ปดํฌ๋ํธํ/Propsํ๋ ๋ณ๋ โ ๊ทธ๋๋ก ๋๋ฉด ์ ์ ๋งํฌ์
.
์ํ 2: Flutter ๋ณํ
ํ๋ฌ๊ทธ์ธ ์ถ๋ ฅ
Container(
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(12),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 48, height: 48,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(image: NetworkImage('...')),
),
),
const SizedBox(height: 16),
const Text('User Name',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w700)),
const SizedBox(height: 4),
const Text('user@example.com',
style: TextStyle(fontSize: 14, color: Color(0xFF6B7280))),
],
),
)
Dart
๋ณต์ฌ
์ํ 3: SwiftUI ๋ณํ
ํ๋ฌ๊ทธ์ธ ์ถ๋ ฅ
VStack(alignment: .leading, spacing: 16) {
Image("avatar")
.resizable()
.frame(width: 48, height: 48)
.clipShape(Circle())
VStack(alignment: .leading, spacing: 4) {
Text("User Name")
.font(.system(size: 16, weight: .bold))
.foregroundColor(Color(red: 0.07, green: 0.09, blue: 0.16))
Text("user@example.com")
.font(.system(size: 14))
.foregroundColor(Color(red: 0.42, green: 0.45, blue: 0.50))
}
}
.padding(24)
.background(Color.white)
.cornerRadius(12)
Swift
๋ณต์ฌ
์ํ 4: AI ํ์ฒ๋ฆฌ โ Tailwind ๊ฒฐ๊ณผ๋ฅผ ์ปดํฌ๋ํธํ
Copilot ํ๋กฌํํธ
๋ค์ Tailwind JSX๋ฅผ props ๋ฐ๋ React ์ปดํฌ๋ํธ๋ก ๋ฆฌํฉํ ๋งํด์ค.
- name, email, avatarUrl props
- TypeScript ํ์
์ ์
- ๋์์ธ ํ ํฐ(@/design-system/tokens)์ด ์๋ค๋ฉด ๊ทธ๊ฒ ์ฌ์ฉ
[Figma to Code ์ถ๋ ฅ ์ฝ๋ ๋ถ์ฌ๋ฃ๊ธฐ]
Plain Text
๋ณต์ฌ
AI ์ถ๋ ฅ
import type { FC } from 'react'
type UserCardProps = {
name: string
email: string
avatarUrl: string
}
export const UserCard: FC<UserCardProps> = ({ name, email, avatarUrl }) => (
<div className="inline-flex flex-col items-start gap-4 rounded-xl bg-white p-6">
<img src={avatarUrl} alt={name} className="h-12 w-12 rounded-full" />
<div className="flex flex-col gap-1">
<span className="text-base font-bold text-gray-900">{name}</span>
<span className="text-sm text-gray-500">{email}</span>
</div>
</div>
)
TypeScript
๋ณต์ฌ
โ ๊ฒฐ์ ์ ๋ณํ(Figma to Code) + ์๋ฏธ ์ถ๋ก (AI) ๊ฒฐํฉ ํจํด
์ํ 5: ๋์์ธ ์์คํ ํ ํฐ ๋งคํ (์๋)
ํ๋ฌ๊ทธ์ธ ์ถ๋ ฅ์ hex๋ฅผ ์ผ๊ด ์นํ:
๊ฒ์: bg-[#2563EB] โ ์นํ: bg-brand-500
๊ฒ์: text-[#111827] โ ์นํ: text-text-primary
๊ฒ์: text-[#6B7280] โ ์นํ: text-text-secondary
Plain Text
๋ณต์ฌ
โข
VS Code ๋ฉํฐ์ปค์ / ์ ๊ท์ ์นํ ํ์ฉ
โข
๋๋ Copilot์ "์ด ํ์ผ์ hex ์์์ tailwind.config์ ํ ํฐ๋ช
์ผ๋ก ์นํ" ์์ฒญ

