Figma → Vue / Vuetify 3
A complete translation reference for every Figma property and its exact CSS / Vue / Vuetify 3 equivalent. Both Design and Tech teams use this as the single source of truth during handoff.
راهنمای جامع ترجمه تمام propertyهای فیگما به معادل دقیق CSS / Vue / Vuetify 3. هر دو تیم Design و Tech از این سند به عنوان منبع اصلی در handoff استفاده میکنند.
1. Sizing Modes۱. Sizing Modes — اندازهگذاری
Figma offers three dimension modes for width and height. Each maps to a different CSS pattern.
فیگما سه حالت برای عرض و ارتفاع دارد. هر کدام به یک الگوی CSS متفاوت تبدیل میشوند.
| Figma | CSS | Vuetify 3 | Noteنکته |
|---|---|---|---|
| Fixed | width: 120px |
style="width: 120px" |
Explicit pixel valueمقدار ثابت |
| Fill | flex: 1 1 0 or width: 100% |
class="flex-grow-1" or class="w-100" |
Use flex: 1 in flex containersدر flex container از flex: 1 استفاده کنید |
| Hug | width: fit-content |
Omit width — defaultحذف width — رفتار پیشفرض | Wraps its contentبه اندازه محتوا |
| Min Width | min-width: {n}px |
style="min-width: {n}px" |
— |
| Max Width | max-width: {n}px |
style="max-width: {n}px" |
— |
flex: 1. If the parent is a block element, use width: 100%. These produce different results.
Fill در کد: اگر parent یک flex container است از flex: 1 استفاده کنید. اگر block است از width: 100%. این دو رفتار متفاوت دارند.
2. Auto Layout۲. Auto Layout — چیدمان خودکار
Auto Layout in Figma is Flexbox in CSS. Direction, gap, padding, and alignment map 1-to-1.
Auto Layout در فیگما معادل Flexbox در CSS است. direction، gap، padding و alignment به صورت مستقیم ترجمه میشوند.
Direction & WrapDirection و Wrap flex-direction
| Figma | CSS | Vuetify 3 |
|---|---|---|
| Horizontal | display:flex; flex-direction:row | class="d-flex flex-row" |
| Vertical | display:flex; flex-direction:column | class="d-flex flex-column" |
| Wrap | flex-wrap: wrap | class="flex-wrap" |
| No Wrap | flex-wrap: nowrap | class="flex-nowrap" |
Gap gap
| Figma | CSS | Vuetify 3 |
|---|---|---|
| Gap (all) | gap: {n}px | class="ga-{n}" |
| Horizontal gap | column-gap: {n}px | class="ga-x-{n}" |
| Vertical gap | row-gap: {n}px | class="ga-y-{n}" |
| Space Between | justify-content: space-between | class="justify-space-between" |
| Space Around | justify-content: space-around | class="justify-space-around" |
Padding padding
| Figma | CSS | Vuetify 3 |
|---|---|---|
| All sidesهمه طرف | padding: {n}px | class="pa-{n}" |
| H (L+R) | padding-inline: {n}px | class="px-{n}" |
| V (T+B) | padding-block: {n}px | class="py-{n}" |
| Top | padding-top: {n}px | class="pt-{n}" |
| Right | padding-right: {n}px | class="pr-{n}" |
| Bottom | padding-bottom: {n}px | class="pb-{n}" |
| Left | padding-left: {n}px | class="pl-{n}" |
Alignment — Primary AxisAlignment — محور اصلی justify-content
| Figma | CSS | Vuetify 3 |
|---|---|---|
| Start | justify-content: flex-start | class="justify-start" |
| Center | justify-content: center | class="justify-center" |
| End | justify-content: flex-end | class="justify-end" |
| Space Between | justify-content: space-between | class="justify-space-between" |
Alignment — Cross AxisAlignment — محور عرضی align-items
| Figma | CSS | Vuetify 3 |
|---|---|---|
| Top / Start | align-items: flex-start | class="align-start" |
| Center | align-items: center | class="align-center" |
| Bottom / End | align-items: flex-end | class="align-end" |
| Baseline | align-items: baseline | class="align-baseline" |
| Stretch | align-items: stretch | class="align-stretch" |
Absolute Position inside Auto LayoutAbsolute Position درون Auto Layout
<!-- Figma: Auto Layout parent + child with "Absolute position" --><!-- فیگما: parent با Auto Layout + فرزند Absolute --> <div class="position-relative d-flex flex-column ga-4"> <div>item 1</div> <div>item 2</div> <!-- absolute child --><!-- فرزند absolute --> <div class="position-absolute" style="top:8px;right:8px">badge</div> </div>
3. Grid Layout۳. Grid Layout — شبکه ستونی
<!-- Mobile: 12col | Tablet: 6col | Desktop: 4col --><!-- موبایل: کامل | تبلت: نصف | دسکتاپ: یکسوم --> <v-container> <v-row> <v-col cols="12" sm="6" md="4">content</v-col> </v-row> </v-container> <v-row no-gutters> <!-- no gutter --><!-- بدون gutter --> <v-row class="ga-4"> <!-- custom gap --><!-- gap سفارشی -->
4. Stroke → Border۴. Stroke → Border
Figma strokes have three positions, each with a different CSS approach.
Stroke در فیگما سه position دارد که هر کدام رویکرد CSS متفاوتی دارند.
Stroke Positionموقعیت Stroke
| Figma | CSS | Noteنکته |
|---|---|---|
| Inside | border: 2px solid #color; |
Element size unchangedاندازه element تغییر نمیکند |
| Outside | outline: 2px solid #color; |
Outside layout flowخارج از layout |
| Center | box-shadow: 0 0 0 1px #color |
Approximation onlyتقریب — دقیق نیست |
box-shadow is the closest approximation but does not perfectly replicate rounded corners.
Center stroke معادل مستقیم در CSS ندارد. box-shadow نزدیکترین تقریب است اما گوشههای گرد را دقیق نمیگیرد.
Stroke Styleاستایل Stroke
| Figma | CSS |
|---|---|
| Solid | border-style: solid |
| Dashed | border-style: dashed |
| Dotted | border-style: dotted |
Per-Side StrokeStroke تکضلعی
| Figma | CSS |
|---|---|
| Top only | border-top: 1px solid #color |
| Right only | border-right: 1px solid #color |
| Bottom only | border-bottom: 1px solid #color |
| Left only | border-left: 1px solid #color |
5. Border Radius۵. Border Radius — گوشههای گرد
Vuetify 3 provides a predefined rounded scale. All Figma border-radius values should map to one of these.
Vuetify 3 یک مقیاس از پیش تعریفشده دارد. تمام مقادیر border-radius فیگما باید به یکی از اینها تبدیل شوند.
border-radius. For pixel-perfect shapes, use an SVG path.
Corner Smoothing فیگما (منحنیهای سبک اپل) معادل CSS ندارد. از border-radius معمولی استفاده کنید. برای دقت بالاتر از SVG path بهره بگیرید.
6. Fill → Background / Color۶. Fill → Background / Color
Solid Fillرنگ solid
| Figma | CSS | Vuetify 3 |
|---|---|---|
| Solid fillرنگ solid | background-color: #HEX | class="bg-{token}" |
| No fill | background: transparent | — |
| Text colorرنگ متن | color: #HEX | class="text-{token}" |
Gradient FillGradient
Formula:
css_angle = (figma_angle + 90) % 360
تبدیل زاویه: فیگما از ۱۲ ساعت میچرخد، CSS از ۳ ساعت.فرمول:
css_angle = (figma_angle + 90) % 360
| Figma Angleزاویه فیگما | CSS deg |
|---|---|
| 0° (top → bottom)(بالا → پایین) | 180deg |
| 90° (left → right)(چپ → راست) | 90deg |
| 180° (bottom → top)(پایین → بالا) | 0deg |
| 270° (right → left)(راست → چپ) | 270deg |
Image FillImage Fill
| Figma Modeحالت فیگما | CSS | Vue |
|---|---|---|
| Fill (Cover) | background:url() center/cover no-repeat | <v-img cover> |
| Fit (Contain) | background:url() center/contain no-repeat | <v-img contain> |
| Crop | object-fit:none; object-position:x y | object-position prop |
| Tile | background:url() repeat | — |
7. Effects → Shadow۷. Effects → سایه و افکت
Drop Shadow → box-shadow
/* Figma: X=0, Y=4, Blur=8, Spread=0, #000 at 20% *//* فیگما: X=0, Y=4, Blur=8, Spread=0, #000 با ۲۰% شفافیت */ box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.20); /* Inner Shadow *//* سایه داخلی */ box-shadow: inset 0px 2px 4px 0px rgba(0, 0, 0, 0.15); /* Multiple shadows *//* چند سایه */ box-shadow: 0px 2px 4px rgba(0,0,0,0.10), 0px 8px 16px rgba(0,0,0,0.08);
Vuetify Elevation Scaleمقیاس Elevation در Vuetify
| Class | Typical Useکاربرد معمول |
|---|---|
elevation-0 | Flat — no shadowبدون سایه |
elevation-2 | Default cardcard پیشفرض |
elevation-4 | Raised cardcard برجسته |
elevation-8 | Menu, tooltipmenu، tooltip |
elevation-16 | Modal, dialogmodal، dialog |
elevation-24 | Navigation drawerNavigation drawer |
Other Effectsافکتهای دیگر
| Figma | CSS |
|---|---|
| Layer Blur | filter: blur(8px) |
| Background Blur | backdrop-filter: blur(12px) |
8. Opacity۸. Opacity — شفافیت
| Figma | CSS | Noteنکته |
|---|---|---|
| Layer Opacity 50% | opacity: 0.5 | All children affectedهمه فرزندان تحت تاثیر |
| Fill opacity | rgba(r, g, b, 0.5) | Only the colorفقط رنگ |
| Disabled (38%) | opacity: 0.38 | Material Design specاستاندارد Material |
opacity on a layer affects all its children. For background-only transparency, use rgba() or rgb(var(--v-theme-primary), 0.1).
تفاوت مهم: opacity روی لایه همه فرزندان را شفاف میکند. برای شفافیت فقط پسزمینه از rgba() یا rgb(var(--v-theme-primary), 0.1) استفاده کنید.
9. Blend Modes۹. Blend Modes
| Figma | mix-blend-mode | Figma | mix-blend-mode |
|---|---|---|---|
| Normal | normal | Overlay | overlay |
| Darken | darken | Soft Light | soft-light |
| Multiply | multiply | Hard Light | hard-light |
| Color Burn | color-burn | Difference | difference |
| Lighten | lighten | Exclusion | exclusion |
| Screen | screen | Hue | hue |
| Color Dodge | color-dodge | Saturation | saturation |
| Plus Lighter | plus-lighter | Luminosity | luminosity |
10. Typography۱۰. Typography — تایپوگرافی
Propertiesویژگیها
| Figma | CSS | Vuetify 3 |
|---|---|---|
| Font Family | font-family: 'Name' | Set in vuetify.js themeتنظیم در vuetify.js |
| Font Size | font-size: 16px | Use type scale belowاز جدول type scale استفاده کنید |
| Font Weight | font-weight: 500 | class="font-weight-medium" |
| Italic | font-style: italic | class="font-italic" |
| Line Height (px) | line-height: 24px | style="line-height: 24px" |
| Letter Spacing | letter-spacing: 0.05em | style="letter-spacing:0.05em" |
| Align Left | text-align: left | class="text-left" |
| Align Center | text-align: center | class="text-center" |
| Align Right | text-align: right | class="text-right" |
| Uppercase | text-transform: uppercase | class="text-uppercase" |
| Underline | text-decoration: underline | — |
| Strikethrough | text-decoration: line-through | — |
| Paragraph Spacingفاصله پاراگراف | margin-bottom: 16px | class="mb-4" |
| Truncate | overflow:hidden; text-overflow:ellipsis; white-space:nowrap | class="text-truncate" |
Vuetify 3 Type Scaleمقیاس تایپ Vuetify 3
11. Spacing System۱۱. Spacing System — سیستم فاصله
Vuetify uses 4px as the base unit. All Figma spacing values must be multiples of 4.
Vuetify از 4px به عنوان واحد پایه استفاده میکند. تمام فاصلههای فیگما باید مضرب ۴ باشند.
/* margin *//* margin */ ma-{n} mx-{n} my-{n} mt-{n} mr-{n} mb-{n} ml-{n} /* padding *//* padding */ pa-{n} px-{n} py-{n} pt-{n} pr-{n} pb-{n} pl-{n} /* gap *//* gap */ ga-{n} ga-x-{n} ga-y-{n} /* center a block *//* وسطچین block */ mx-auto
12. Constraints → Positioning۱۲. Constraints → Positioning
Constraints apply only inside non-Auto-Layout frames. Inside Auto Layout, use flexbox alignment instead.
Constraints فقط در Frameهای non-Auto-Layout معنی دارند. درون Auto Layout از flexbox alignment استفاده کنید.
| Figma | CSS |
|---|---|
| Left | position: absolute; left: {n}px |
| Right | position: absolute; right: {n}px |
| Top | position: absolute; top: {n}px |
| Bottom | position: absolute; bottom: {n}px |
| Left & Right (stretch) | position: absolute; left: {n}px; right: {n}px |
| Top & Bottom (stretch) | position: absolute; top: {n}px; bottom: {n}px |
| Center H | position:absolute; left:50%; transform:translateX(-50%) |
| Center V | position:absolute; top:50%; transform:translateY(-50%) |
| Center H+V | position:absolute; top:50%; left:50%; transform:translate(-50%,-50%) |
13. Component Structure۱۳. ساختار کامپوننت
| Figma | Vue / Vuetify |
|---|---|
| Frame | <div>, <v-sheet>, <v-card> |
| Group | <div> (no semantic meaning)(بدون معنای semantic) |
| Section | <section> |
| Component (main) | Vue SFC — <script setup> |
| Instance | <MyComponent /> |
| Variant | props: { variant: 'filled' | 'outlined' } |
| Boolean Property | v-if / v-show |
| Text Property | Vue prop or slotprop یا slot |
| Instance Swap | <component :is="comp" /> |
14. Component States۱۴. Component States
| Figma StateState فیگما | CSS | Vue / Vuetify |
|---|---|---|
| Default | — | — |
| Hover | :hover | @mouseenter / @mouseleave |
| Pressed | :active | @mousedown |
| Focused | :focus, :focus-visible | @focus / @blur |
| Disabled | :disabled + opacity: 0.38 | :disabled="true" |
| Error | .v-input--error | :error="true" |
| Loading | — | :loading="true" |
| Selected | .selected | v-model / :model-value |
15. Responsive / Breakpoints۱۵. Responsive / Breakpoints
| Figma Frameفریم فیگما | Vuetify | Range |
|---|---|---|
| Mobile (360px) | xs | < 600px |
| Tablet (768px) | sm | 600–959px |
| Laptop (1280px) | md | 960–1279px |
| Desktop (1440px) | lg | 1280–1919px |
| Wide (1920px) | xl | 1920–2559px |
| Ultra-wide | xxl | ≥ 2560px |
<!-- Mobile only --><!-- فقط موبایل --> <div class="d-flex d-sm-none"> <!-- Hidden on mobile --><!-- پنهان در موبایل --> <div class="d-none d-sm-flex"> <!-- Responsive columns --><!-- ستون responsive --> <v-col cols="12" sm="6" md="4">
16. Clip Content & Z-index۱۶. Clip و Z-index
Clip Content
| Figma | CSS |
|---|---|
| Clip content ✓ | overflow: hidden |
| Clip content ✗ | overflow: visible |
| Scroll insideاسکرول داخلی | overflow: auto |
| Clip with shapeکلیپ با شکل | clip-path: polygon(...) |
Z-index
| Contextکاربرد | Vuetify z-index |
|---|---|
| Baseپایه | 0 |
| Tooltip / Menu | 2000 |
| Overlay backdrop | 2300 |
| Dialog / Modal | 2400 |
| App Bar | 1004 |
| Snackbar | 2500 |
17. Images & Icons۱۷. تصویر و آیکون
<!-- Cover (Figma: Fill) --><!-- کاور (فیگما: Fill) --> <v-img :src="url" cover :aspect-ratio="16/9" /> <!-- Contain (Figma: Fit) --><!-- Contain (فیگما: Fit) --> <v-img :src="url" contain /> <!-- With placeholder --><!-- با placeholder --> <v-img :src="url" cover> <template #placeholder> <v-skeleton-loader type="image" /> </template> </v-img> <!-- Icon — always MDI --><!-- آیکون — همیشه MDI --> <v-icon size="24" color="primary">mdi-check-circle</v-icon>
18. Color System۱۸. سیستم رنگ
| Token | Usageکاربرد | Vue |
|---|---|---|
primary | Brand main colorرنگ اصلی برند | color="primary" |
secondary | Supporting colorرنگ مکمل | color="secondary" |
error | Error stateخطا | color="error" |
warning | Warning stateهشدار | color="warning" |
info | Informationalاطلاعات | color="info" |
success | Success stateموفقیت | color="success" |
surface | Card backgroundپسزمینه card | class="bg-surface" |
/* Theme color with opacity *//* رنگ theme با opacity */ background: rgb(var(--v-theme-primary), 0.1); color: rgb(var(--v-theme-on-surface));
19. Special Cases & Common Pitfalls۱۹. موارد خاص و دامهای رایج
Fill width inside Auto LayoutFill width درون Auto Layout
<div class="d-flex flex-row"> <div style="width:48px">icon</div> <div class="flex-grow-1"> <!-- Fill --><!-- Fill --> content </div> </div>
Nested Auto Layout — most common patternNested Auto Layout — رایجترین الگو
Figma: outer (Vertical, gap=16, padding=24) └─ inner (Horizontal, gap=8, align=center) ├─ icon (Fixed 24×24) └─ label (Fill) <div class="d-flex flex-column ga-4 pa-6"> <div class="d-flex flex-row ga-2 align-center"> <v-icon size="24">mdi-check</v-icon> <span class="flex-grow-1">label</span> </div> </div>
Gradient angle conversionتبدیل زاویه gradient
css_angle = (figma_angle + 90) % 360 Figma 0° → CSS 180deg (top → bottom)(بالا → پایین) Figma 90° → CSS 90deg (left → right)(چپ → راست) Figma 180° → CSS 0deg (bottom → top)(پایین → بالا) Figma 270° → CSS 270deg (right → left)(راست → چپ)
Image aspect ratioنسبت تصویر
<v-img :src="url" :aspect-ratio="16/9" cover /> <!-- Or CSS --><!-- یا CSS --> <div style="aspect-ratio:16/9; overflow:hidden"> <img style="width:100%;height:100%;object-fit:cover"> </div>
Handoff Checklistچکلیست Handoff
Before sending a design to the Tech team, verify all items below.
قبل از ارسال طراحی به تیم Tech، همه موارد زیر را بررسی کنید.
- ✓All spacing values are multiples of 4pxتمام فاصلهها مضرب ۴px هستند
- ✓Font sizes match the Vuetify type scaleاندازههای فونت با Vuetify type scale تطابق دارند
- ✓Colors reference design tokens — not raw hex valuesرنگها به design token اشاره میکنند، نه hex مستقیم
- ✓Auto Layout direction (H/V) and gap are clearly annotateddirection و gap در Auto Layout مشخص شدهاند
- ✓Padding is explicitly set on every framePadding روی هر فریم به صراحت تنظیم شده
- ✓Responsive frames exist (mobile / tablet / desktop)فریمهای responsive وجود دارند (موبایل / تبلت / دسکتاپ)
- ✓All states are designed: hover / disabled / error / loadingهمه states طراحی شدهاند: hover / disabled / error / loading
- ✓Stroke position is specified: inside / outside / centerموقعیت Stroke مشخص است: inside / outside / center
- ✓Image fill mode is specified: cover / contain / cropحالت image fill مشخص است: cover / contain / crop
- ✓Component variants map to Vue propsVariantهای کامپوننت به Vue props تبدیل شدهاند
- ✓Icons are from MDI or their names are specifiedآیکونها از MDI هستند یا نامشان مشخص شده
- ✓Border radius values match Vuetify scaleمقادیر border-radius با مقیاس Vuetify تطابق دارند
- ✓Elevation matches Vuetify scale (0/2/4/8/12/16/24)Elevation با مقیاس Vuetify تطابق دارد
- ✓Clip content is set on frames with overflowClip content روی فریمهای overflow تنظیم شده