Spaces:
Runtime error
Runtime error
feat: move Figma plugin to figma-plugin/ with proper README
Browse files- Move plugin from deeply nested output_json/figma-plugin-extracted/
to clean top-level figma-plugin/ folder
- Add comprehensive README with setup guide, DTCG + legacy JSON
examples, visual spec preview, AS-IS/TO-BE workflow, troubleshooting
- Update manifest.json with new branding
- Remove old INSTALLATION.md, QUICK_SETUP.md (consolidated into README)
- Add old plugin path to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- .gitignore +1 -0
- figma-plugin/README.md +265 -0
- {output_json/figma-plugin-extracted/figma-design-token-creator 5 → figma-plugin}/manifest.json +1 -1
- {output_json/figma-plugin-extracted/figma-design-token-creator 5 → figma-plugin}/src/code.js +0 -0
- {output_json/figma-plugin-extracted/figma-design-token-creator 5 → figma-plugin}/ui/ui.html +0 -0
- output_json/figma-plugin-extracted/figma-design-token-creator 5/INSTALLATION.md +0 -205
- output_json/figma-plugin-extracted/figma-design-token-creator 5/QUICK_SETUP.md +0 -49
- output_json/figma-plugin-extracted/figma-design-token-creator 5/README.md +0 -182
.gitignore
CHANGED
|
@@ -30,3 +30,4 @@ content/
|
|
| 30 |
# Data files (sample outputs, caches)
|
| 31 |
storage/benchmark_cache.json
|
| 32 |
output_json/*.json
|
|
|
|
|
|
| 30 |
# Data files (sample outputs, caches)
|
| 31 |
storage/benchmark_cache.json
|
| 32 |
output_json/*.json
|
| 33 |
+
output_json/figma-plugin-extracted/
|
figma-plugin/README.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Design System Automation — Figma Plugin
|
| 2 |
+
|
| 3 |
+
Import design tokens into Figma and auto-generate a visual spec page. Works with W3C DTCG format (from the Design System Automation app) and legacy JSON formats.
|
| 4 |
+
|
| 5 |
+
  
|
| 6 |
+
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
## What It Does
|
| 10 |
+
|
| 11 |
+
Upload a JSON file with your design tokens. The plugin creates:
|
| 12 |
+
|
| 13 |
+
- **Figma Variables** — Color, number, and string variable collections
|
| 14 |
+
- **Paint Styles** — Every color as a reusable Figma paint style
|
| 15 |
+
- **Text Styles** — Typography with font family, size, weight, and line height
|
| 16 |
+
- **Effect Styles** — Shadows as Figma effect styles
|
| 17 |
+
- **Visual Spec Page** — Auto-generated frames showing all your tokens organized by category, with AA compliance badges on every color
|
| 18 |
+
|
| 19 |
+
The plugin auto-detects whether your JSON uses the **W3C DTCG format** (`$value`, `$type`) or a **legacy format** (`value`, `type`) and handles both.
|
| 20 |
+
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
## Quick Setup (5 Minutes)
|
| 24 |
+
|
| 25 |
+
### 1. Download the plugin
|
| 26 |
+
|
| 27 |
+
Clone this repo or download just the `figma-plugin/` folder. You need these three files:
|
| 28 |
+
|
| 29 |
+
```
|
| 30 |
+
figma-plugin/
|
| 31 |
+
manifest.json
|
| 32 |
+
src/code.js
|
| 33 |
+
ui/ui.html
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
### 2. Load into Figma
|
| 37 |
+
|
| 38 |
+
1. Open **Figma** (desktop app)
|
| 39 |
+
2. Go to **Plugins** > **Development** > **Import plugin from manifest...**
|
| 40 |
+
3. Select the `manifest.json` file from this folder
|
| 41 |
+
4. Done — the plugin is now available under **Plugins > Development**
|
| 42 |
+
|
| 43 |
+
### 3. Run it
|
| 44 |
+
|
| 45 |
+
1. Open any Figma file (or create a new one)
|
| 46 |
+
2. Go to **Plugins** > **Development** > **Design System Automation — Token Importer**
|
| 47 |
+
3. Upload your JSON file or paste JSON directly
|
| 48 |
+
4. Click **"Apply to Document"**
|
| 49 |
+
5. Check the **Assets** panel — all your styles and variables are created
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
## How to Get Your Token JSON
|
| 54 |
+
|
| 55 |
+
### Option A: Use the Design System Automation App (Recommended)
|
| 56 |
+
|
| 57 |
+
1. Go to the [Design System Automation app](https://huggingface.co/spaces/riazmo/Design-System-Automation)
|
| 58 |
+
2. Enter any website URL
|
| 59 |
+
3. Click Extract — the app analyzes the site and extracts all design tokens
|
| 60 |
+
4. Download the **AS-IS JSON** (W3C DTCG format)
|
| 61 |
+
5. Upload it to this plugin
|
| 62 |
+
|
| 63 |
+
### Option B: Create JSON Manually
|
| 64 |
+
|
| 65 |
+
The plugin accepts two formats:
|
| 66 |
+
|
| 67 |
+
**W3C DTCG Format** (recommended — output from the app):
|
| 68 |
+
```json
|
| 69 |
+
{
|
| 70 |
+
"color": {
|
| 71 |
+
"brand": {
|
| 72 |
+
"primary": {
|
| 73 |
+
"$type": "color",
|
| 74 |
+
"$value": "#0066ff",
|
| 75 |
+
"$description": "Primary brand color"
|
| 76 |
+
}
|
| 77 |
+
},
|
| 78 |
+
"text": {
|
| 79 |
+
"primary": {
|
| 80 |
+
"$type": "color",
|
| 81 |
+
"$value": "#1a1a1a"
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
},
|
| 85 |
+
"font": {
|
| 86 |
+
"heading": {
|
| 87 |
+
"lg": {
|
| 88 |
+
"$type": "typography",
|
| 89 |
+
"$value": {
|
| 90 |
+
"fontFamily": "Inter",
|
| 91 |
+
"fontSize": "32px",
|
| 92 |
+
"fontWeight": "700",
|
| 93 |
+
"lineHeight": "1.3"
|
| 94 |
+
}
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
},
|
| 98 |
+
"spacing": {
|
| 99 |
+
"md": {
|
| 100 |
+
"$type": "dimension",
|
| 101 |
+
"$value": "16px"
|
| 102 |
+
}
|
| 103 |
+
},
|
| 104 |
+
"radius": {
|
| 105 |
+
"md": {
|
| 106 |
+
"$type": "dimension",
|
| 107 |
+
"$value": "8px"
|
| 108 |
+
}
|
| 109 |
+
},
|
| 110 |
+
"shadow": {
|
| 111 |
+
"sm": {
|
| 112 |
+
"$type": "shadow",
|
| 113 |
+
"$value": {
|
| 114 |
+
"offsetX": "0px",
|
| 115 |
+
"offsetY": "2px",
|
| 116 |
+
"blur": "8px",
|
| 117 |
+
"spread": "0px",
|
| 118 |
+
"color": "#00000026"
|
| 119 |
+
}
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
**Legacy Format** (also supported):
|
| 126 |
+
```json
|
| 127 |
+
{
|
| 128 |
+
"global": {
|
| 129 |
+
"colors": {
|
| 130 |
+
"primary": { "value": "#0066ff", "type": "color" },
|
| 131 |
+
"secondary": { "value": "#ff007f", "type": "color" }
|
| 132 |
+
},
|
| 133 |
+
"typography": {
|
| 134 |
+
"heading": {
|
| 135 |
+
"value": {
|
| 136 |
+
"fontFamily": "Inter",
|
| 137 |
+
"fontWeight": "700",
|
| 138 |
+
"fontSize": "32px",
|
| 139 |
+
"lineHeight": "1.3"
|
| 140 |
+
},
|
| 141 |
+
"type": "typography"
|
| 142 |
+
}
|
| 143 |
+
},
|
| 144 |
+
"spacing": {
|
| 145 |
+
"md": { "value": "16px", "type": "spacing" }
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
---
|
| 152 |
+
|
| 153 |
+
## The Visual Spec Page
|
| 154 |
+
|
| 155 |
+
After importing, the plugin generates a visual spec page with separate frames for each token category:
|
| 156 |
+
|
| 157 |
+
```
|
| 158 |
+
+------------------------------------------------------------------+
|
| 159 |
+
| TYPOGRAPHY (Desktop) TYPOGRAPHY (Mobile) |
|
| 160 |
+
| H1 48px/Bold Inter H1 32px/Bold Inter |
|
| 161 |
+
| H2 36px/Bold Inter H2 28px/Bold Inter |
|
| 162 |
+
| Body 16px/Regular Inter Body 14px/Regular Inter |
|
| 163 |
+
+------------------------------------------------------------------+
|
| 164 |
+
| COLORS |
|
| 165 |
+
| BRAND TEXT BACKGROUND FEEDBACK |
|
| 166 |
+
| +------+ +------+ +------+ +------+ |
|
| 167 |
+
| |Primary| |Primary| |Primary| | Error| |
|
| 168 |
+
| +------+ +------+ +------+ +------+ |
|
| 169 |
+
| #0066ff #1a1a1a #ffffff #dc2626 |
|
| 170 |
+
| AA:Pass AA:Pass AA:Pass |
|
| 171 |
+
+------------------------------------------------------------------+
|
| 172 |
+
| SPACING RADIUS SHADOWS |
|
| 173 |
+
| 4 8 16 24 sm md lg full xs sm md lg xl |
|
| 174 |
+
+------------------------------------------------------------------+
|
| 175 |
+
```
|
| 176 |
+
|
| 177 |
+
Every color swatch shows its AA compliance status (Pass/Fail against white and black backgrounds).
|
| 178 |
+
|
| 179 |
+
---
|
| 180 |
+
|
| 181 |
+
## AS-IS vs TO-BE Workflow
|
| 182 |
+
|
| 183 |
+
The full Design System Automation workflow uses this plugin twice:
|
| 184 |
+
|
| 185 |
+
1. **Extract AS-IS** — Run the app on a website, download JSON, import to Figma
|
| 186 |
+
2. **Review** — See the current state of the design system as a visual spec
|
| 187 |
+
3. **AI Analysis** — The app's 4 AI agents analyze and suggest improvements
|
| 188 |
+
4. **Accept/Reject** — Choose which suggestions to keep
|
| 189 |
+
5. **Export TO-BE** — Download the improved JSON, import to Figma
|
| 190 |
+
6. **Compare** — Place AS-IS and TO-BE visual specs side by side
|
| 191 |
+
|
| 192 |
+
This gives you a clear before/after view of every change.
|
| 193 |
+
|
| 194 |
+
---
|
| 195 |
+
|
| 196 |
+
## Plugin Features
|
| 197 |
+
|
| 198 |
+
| Feature | Description |
|
| 199 |
+
|---------|-------------|
|
| 200 |
+
| DTCG Auto-Detection | Automatically detects W3C DTCG vs legacy JSON format |
|
| 201 |
+
| Figma Variables | Creates Color, Number, and String variable collections |
|
| 202 |
+
| Paint Styles | Every color token becomes a reusable paint style |
|
| 203 |
+
| Text Styles | Typography tokens with font, size, weight, line height |
|
| 204 |
+
| Effect Styles | Shadow tokens as Figma drop shadow effects |
|
| 205 |
+
| Visual Spec | Auto-generated spec page with organized frames |
|
| 206 |
+
| AA Badges | Contrast ratio check on every color swatch |
|
| 207 |
+
| File Upload | Upload JSON file or paste directly |
|
| 208 |
+
| Token Preview | See all detected tokens before applying |
|
| 209 |
+
| Progress Bar | Real-time feedback while creating styles |
|
| 210 |
+
|
| 211 |
+
---
|
| 212 |
+
|
| 213 |
+
## Troubleshooting
|
| 214 |
+
|
| 215 |
+
**Plugin won't load?**
|
| 216 |
+
- Make sure you're using the Figma desktop app (not the browser version)
|
| 217 |
+
- Check that `manifest.json`, `src/code.js`, and `ui/ui.html` are all present
|
| 218 |
+
- Try: Plugins > Development > Import plugin from manifest... and re-select
|
| 219 |
+
|
| 220 |
+
**Styles not appearing?**
|
| 221 |
+
- Open the **Assets** panel (left sidebar) and check under Local styles
|
| 222 |
+
- Make sure you clicked "Apply to Document" and waited for the progress bar
|
| 223 |
+
- Try refreshing: Cmd+R (Mac) or Ctrl+R (Windows)
|
| 224 |
+
|
| 225 |
+
**JSON upload fails?**
|
| 226 |
+
- Validate your JSON at [jsonlint.com](https://jsonlint.com)
|
| 227 |
+
- Check that hex colors use the full 6-digit format: `#0066ff` (not `#06f`)
|
| 228 |
+
- Make sure font sizes include units: `"32px"` (not `"32"`)
|
| 229 |
+
|
| 230 |
+
**Fonts look wrong?**
|
| 231 |
+
- Figma needs the font installed on your system or available through Google Fonts
|
| 232 |
+
- If a font isn't found, Figma falls back to a default — install the font and re-run
|
| 233 |
+
|
| 234 |
+
---
|
| 235 |
+
|
| 236 |
+
## Project Structure
|
| 237 |
+
|
| 238 |
+
```
|
| 239 |
+
figma-plugin/
|
| 240 |
+
manifest.json # Plugin configuration (name, entry points)
|
| 241 |
+
README.md # This file
|
| 242 |
+
src/
|
| 243 |
+
code.js # Main plugin logic (v7, ~1400 lines)
|
| 244 |
+
ui/
|
| 245 |
+
ui.html # Plugin UI panel
|
| 246 |
+
```
|
| 247 |
+
|
| 248 |
+
---
|
| 249 |
+
|
| 250 |
+
## Compatibility
|
| 251 |
+
|
| 252 |
+
- **Figma**: Desktop app (latest version recommended)
|
| 253 |
+
- **JSON Formats**: W3C DTCG v1, Tokens Studio, legacy `{value, type}` format
|
| 254 |
+
- **Token Types**: Colors, typography, spacing, border radius, shadows
|
| 255 |
+
- **Downstream**: Works with tokens exported from Tokens Studio, Style Dictionary, or the Design System Automation app
|
| 256 |
+
|
| 257 |
+
---
|
| 258 |
+
|
| 259 |
+
## License
|
| 260 |
+
|
| 261 |
+
MIT — free to use, modify, and distribute.
|
| 262 |
+
|
| 263 |
+
---
|
| 264 |
+
|
| 265 |
+
Built as part of [Design System Automation](https://github.com/hiriazmo/design-system-automation) — an open-source tool that extracts, analyzes, and improves design systems from any live website.
|
{output_json/figma-plugin-extracted/figma-design-token-creator 5 → figma-plugin}/manifest.json
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"name": "Design Token
|
| 3 |
"id": "1234567890",
|
| 4 |
"api": "1.0.0",
|
| 5 |
"main": "src/code.js",
|
|
|
|
| 1 |
{
|
| 2 |
+
"name": "Design System Automation — Token Importer",
|
| 3 |
"id": "1234567890",
|
| 4 |
"api": "1.0.0",
|
| 5 |
"main": "src/code.js",
|
{output_json/figma-plugin-extracted/figma-design-token-creator 5 → figma-plugin}/src/code.js
RENAMED
|
File without changes
|
{output_json/figma-plugin-extracted/figma-design-token-creator 5 → figma-plugin}/ui/ui.html
RENAMED
|
File without changes
|
output_json/figma-plugin-extracted/figma-design-token-creator 5/INSTALLATION.md
DELETED
|
@@ -1,205 +0,0 @@
|
|
| 1 |
-
# Design Token Creator - Installation Guide
|
| 2 |
-
|
| 3 |
-
A custom Figma plugin that automatically creates color styles, text styles, and spacing tokens from your design tokens JSON file.
|
| 4 |
-
|
| 5 |
-
## Features
|
| 6 |
-
|
| 7 |
-
✅ Upload JSON design tokens
|
| 8 |
-
✅ Preview all tokens before applying
|
| 9 |
-
✅ Create color styles automatically
|
| 10 |
-
✅ Create text styles automatically
|
| 11 |
-
✅ Create spacing tokens automatically
|
| 12 |
-
✅ Progress indicator while processing
|
| 13 |
-
✅ No credits needed - completely free
|
| 14 |
-
|
| 15 |
-
---
|
| 16 |
-
|
| 17 |
-
## Installation Steps
|
| 18 |
-
|
| 19 |
-
### Step 1: Prepare the Plugin Files
|
| 20 |
-
|
| 21 |
-
1. You should have these files:
|
| 22 |
-
- `manifest.json`
|
| 23 |
-
- `src/code.js`
|
| 24 |
-
- `ui/ui.html`
|
| 25 |
-
|
| 26 |
-
2. Create a folder structure:
|
| 27 |
-
```
|
| 28 |
-
design-token-creator/
|
| 29 |
-
├── manifest.json
|
| 30 |
-
├── src/
|
| 31 |
-
│ └── code.js
|
| 32 |
-
└── ui/
|
| 33 |
-
└── ui.html
|
| 34 |
-
```
|
| 35 |
-
|
| 36 |
-
### Step 2: Load Plugin into Figma
|
| 37 |
-
|
| 38 |
-
1. Open **Figma** and go to any file
|
| 39 |
-
2. Go to **Plugins** menu → **Development** → **New plugin**
|
| 40 |
-
3. Select **Link existing plugin**
|
| 41 |
-
4. Choose the folder containing your plugin files
|
| 42 |
-
5. Click **Open**
|
| 43 |
-
|
| 44 |
-
### Step 3: Run the Plugin
|
| 45 |
-
|
| 46 |
-
1. In Figma, go to **Plugins** → **Development** → **Design Token Creator**
|
| 47 |
-
2. The plugin panel will open on the right side
|
| 48 |
-
|
| 49 |
-
---
|
| 50 |
-
|
| 51 |
-
## How to Use
|
| 52 |
-
|
| 53 |
-
### Step 1: Upload Your JSON File
|
| 54 |
-
|
| 55 |
-
You have two options:
|
| 56 |
-
|
| 57 |
-
**Option A: Choose File**
|
| 58 |
-
1. Click the **"Choose File"** button
|
| 59 |
-
2. Select your `design-tokens.json` file
|
| 60 |
-
3. The plugin will load and display all tokens
|
| 61 |
-
|
| 62 |
-
**Option B: Paste JSON**
|
| 63 |
-
1. Click the **"Paste JSON"** button
|
| 64 |
-
2. Paste your JSON content
|
| 65 |
-
3. Click OK
|
| 66 |
-
|
| 67 |
-
### Step 2: Preview Tokens
|
| 68 |
-
|
| 69 |
-
The plugin will show you:
|
| 70 |
-
- **Colors** - All color tokens with hex values
|
| 71 |
-
- **Typography** - All text styles with size and weight
|
| 72 |
-
- **Spacing** - All spacing units
|
| 73 |
-
|
| 74 |
-
### Step 3: Apply to Document
|
| 75 |
-
|
| 76 |
-
1. Click **"Apply to Document"** button
|
| 77 |
-
2. Wait for the progress bar to complete
|
| 78 |
-
3. You'll see a success message
|
| 79 |
-
|
| 80 |
-
### Step 4: Check Your Styles
|
| 81 |
-
|
| 82 |
-
1. In Figma, open the **Assets** panel (left sidebar)
|
| 83 |
-
2. You'll see:
|
| 84 |
-
- **Color Styles** folder with all your colors
|
| 85 |
-
- **Text Styles** folder with all typography
|
| 86 |
-
- **Spacing** tokens as text styles
|
| 87 |
-
|
| 88 |
-
---
|
| 89 |
-
|
| 90 |
-
## Your JSON Format
|
| 91 |
-
|
| 92 |
-
The plugin expects this JSON structure:
|
| 93 |
-
|
| 94 |
-
```json
|
| 95 |
-
{
|
| 96 |
-
"global": {
|
| 97 |
-
"colors": {
|
| 98 |
-
"teal": {
|
| 99 |
-
"value": "#00A09A",
|
| 100 |
-
"type": "color"
|
| 101 |
-
},
|
| 102 |
-
"hot-pink": {
|
| 103 |
-
"value": "#FF007F",
|
| 104 |
-
"type": "color"
|
| 105 |
-
}
|
| 106 |
-
},
|
| 107 |
-
"typography": {
|
| 108 |
-
"h1": {
|
| 109 |
-
"value": {
|
| 110 |
-
"fontFamily": "Montserrat",
|
| 111 |
-
"fontWeight": "700",
|
| 112 |
-
"fontSize": "48px",
|
| 113 |
-
"lineHeight": "1.2"
|
| 114 |
-
},
|
| 115 |
-
"type": "typography"
|
| 116 |
-
}
|
| 117 |
-
},
|
| 118 |
-
"spacing": {
|
| 119 |
-
"xs": {
|
| 120 |
-
"value": "8px",
|
| 121 |
-
"type": "spacing"
|
| 122 |
-
}
|
| 123 |
-
}
|
| 124 |
-
}
|
| 125 |
-
}
|
| 126 |
-
```
|
| 127 |
-
|
| 128 |
-
---
|
| 129 |
-
|
| 130 |
-
## What Gets Created
|
| 131 |
-
|
| 132 |
-
### Color Styles
|
| 133 |
-
- Named as: `colors/[name]`
|
| 134 |
-
- Example: `colors/teal`, `colors/hot-pink`
|
| 135 |
-
- Can be used in any fill or stroke
|
| 136 |
-
|
| 137 |
-
### Text Styles
|
| 138 |
-
- Named as: `typography/[name]`
|
| 139 |
-
- Example: `typography/h1`, `typography/body`
|
| 140 |
-
- Includes font family, size, weight, and line height
|
| 141 |
-
|
| 142 |
-
### Spacing Tokens
|
| 143 |
-
- Named as: `spacing/[name]`
|
| 144 |
-
- Example: `spacing/xs`, `spacing/md`
|
| 145 |
-
- Stored as text styles for reference
|
| 146 |
-
|
| 147 |
-
---
|
| 148 |
-
|
| 149 |
-
## Troubleshooting
|
| 150 |
-
|
| 151 |
-
### Plugin doesn't load
|
| 152 |
-
- Make sure all three files are in the correct folder structure
|
| 153 |
-
- Check that `manifest.json` is in the root folder
|
| 154 |
-
- Restart Figma and try again
|
| 155 |
-
|
| 156 |
-
### Styles not appearing
|
| 157 |
-
- Check the Assets panel on the left sidebar
|
| 158 |
-
- Make sure you clicked "Apply to Document"
|
| 159 |
-
- Try refreshing the page (Cmd+R or Ctrl+R)
|
| 160 |
-
|
| 161 |
-
### JSON upload fails
|
| 162 |
-
- Verify your JSON is valid (use jsonlint.com)
|
| 163 |
-
- Make sure it follows the expected structure
|
| 164 |
-
- Check for missing commas or quotes
|
| 165 |
-
|
| 166 |
-
### Styles have wrong values
|
| 167 |
-
- Double-check your JSON values
|
| 168 |
-
- Make sure hex colors are valid (e.g., #00A09A)
|
| 169 |
-
- Verify font sizes include "px" (e.g., "48px")
|
| 170 |
-
|
| 171 |
-
---
|
| 172 |
-
|
| 173 |
-
## Tips & Best Practices
|
| 174 |
-
|
| 175 |
-
1. **Keep JSON organized** - Use clear token names
|
| 176 |
-
2. **Test first** - Create a test file before applying to main designs
|
| 177 |
-
3. **Update regularly** - Re-run the plugin when tokens change
|
| 178 |
-
4. **Use consistent naming** - Follow the naming convention (e.g., `colors/`, `typography/`)
|
| 179 |
-
5. **Backup your file** - Save your Figma file before running the plugin
|
| 180 |
-
|
| 181 |
-
---
|
| 182 |
-
|
| 183 |
-
## Support
|
| 184 |
-
|
| 185 |
-
If you encounter any issues:
|
| 186 |
-
|
| 187 |
-
1. Check that your JSON is valid
|
| 188 |
-
2. Verify the folder structure is correct
|
| 189 |
-
3. Make sure you're using the latest Figma version
|
| 190 |
-
4. Try restarting Figma
|
| 191 |
-
|
| 192 |
-
---
|
| 193 |
-
|
| 194 |
-
## What's Next?
|
| 195 |
-
|
| 196 |
-
After creating your styles:
|
| 197 |
-
|
| 198 |
-
1. **Create components** using these styles
|
| 199 |
-
2. **Build design system pages** showing all tokens
|
| 200 |
-
3. **Share with your team** by publishing as a library
|
| 201 |
-
4. **Keep tokens updated** as your design system evolves
|
| 202 |
-
|
| 203 |
-
---
|
| 204 |
-
|
| 205 |
-
**Enjoy your new design system!** 🎨
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output_json/figma-plugin-extracted/figma-design-token-creator 5/QUICK_SETUP.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
| 1 |
-
# ⚡ Quick Setup - 5 Minutes
|
| 2 |
-
|
| 3 |
-
Get the Design Token Creator plugin running in Figma in 5 minutes.
|
| 4 |
-
|
| 5 |
-
## Step 1: Extract the Plugin (1 minute)
|
| 6 |
-
|
| 7 |
-
1. Download `figma-design-token-creator.zip`
|
| 8 |
-
2. Extract it to a folder on your computer
|
| 9 |
-
3. You should see these files:
|
| 10 |
-
- `manifest.json`
|
| 11 |
-
- `src/code.js`
|
| 12 |
-
- `ui/ui.html`
|
| 13 |
-
- `README.md`
|
| 14 |
-
- `INSTALLATION.md`
|
| 15 |
-
|
| 16 |
-
## Step 2: Load into Figma (2 minutes)
|
| 17 |
-
|
| 18 |
-
1. Open **Figma** and open any file
|
| 19 |
-
2. Go to **Plugins** → **Development** → **New plugin**
|
| 20 |
-
3. Click **"Link existing plugin"**
|
| 21 |
-
4. Select the extracted folder
|
| 22 |
-
5. Click **"Open"**
|
| 23 |
-
|
| 24 |
-
✅ Plugin is now loaded!
|
| 25 |
-
|
| 26 |
-
## Step 3: Run the Plugin (1 minute)
|
| 27 |
-
|
| 28 |
-
1. Go to **Plugins** → **Development** → **Design Token Creator**
|
| 29 |
-
2. The plugin panel opens on the right
|
| 30 |
-
|
| 31 |
-
## Step 4: Use It (1 minute)
|
| 32 |
-
|
| 33 |
-
1. Click **"Choose File"** or **"Paste JSON"**
|
| 34 |
-
2. Select your `design-tokens.json` file
|
| 35 |
-
3. Click **"Apply to Document"**
|
| 36 |
-
4. Wait for completion ✨
|
| 37 |
-
|
| 38 |
-
## Step 5: Check Your Styles
|
| 39 |
-
|
| 40 |
-
Open **Assets** panel on the left sidebar:
|
| 41 |
-
- ✅ **Color Styles** - All your colors
|
| 42 |
-
- ✅ **Text Styles** - All typography
|
| 43 |
-
- ✅ **Spacing** - All spacing tokens
|
| 44 |
-
|
| 45 |
-
---
|
| 46 |
-
|
| 47 |
-
**That's it!** Your design system is ready. 🎉
|
| 48 |
-
|
| 49 |
-
For detailed instructions, see `INSTALLATION.md`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output_json/figma-plugin-extracted/figma-design-token-creator 5/README.md
DELETED
|
@@ -1,182 +0,0 @@
|
|
| 1 |
-
# Design Token Creator - Figma Plugin
|
| 2 |
-
|
| 3 |
-
A powerful, free Figma plugin that automatically creates color styles, text styles, and spacing tokens from your design tokens JSON file.
|
| 4 |
-
|
| 5 |
-
## 🎯 What It Does
|
| 6 |
-
|
| 7 |
-
Upload a JSON file with your design tokens and the plugin will automatically create:
|
| 8 |
-
|
| 9 |
-
- ✅ **Color Styles** - All your brand colors as Figma color styles
|
| 10 |
-
- ✅ **Text Styles** - Complete typography system with font families, sizes, weights, and line heights
|
| 11 |
-
- ✅ **Spacing Tokens** - All spacing units for consistent layouts
|
| 12 |
-
|
| 13 |
-
## 🚀 Quick Start
|
| 14 |
-
|
| 15 |
-
1. **Create an empty Figma file**
|
| 16 |
-
2. **Open the plugin** (Plugins → Development → Design Token Creator)
|
| 17 |
-
3. **Upload your JSON** file with design tokens
|
| 18 |
-
4. **Click "Apply to Document"**
|
| 19 |
-
5. **Check your Assets panel** - All styles are created! ✨
|
| 20 |
-
|
| 21 |
-
## 📋 Features
|
| 22 |
-
|
| 23 |
-
- 🎨 **Beautiful UI** - Clean, intuitive interface
|
| 24 |
-
- 📤 **Multiple Input Methods** - Upload file or paste JSON
|
| 25 |
-
- 👁️ **Token Preview** - See all tokens before applying
|
| 26 |
-
- ⏳ **Progress Indicator** - Real-time feedback while creating styles
|
| 27 |
-
- 🎯 **Accurate Naming** - Tokens organized by category (colors/, typography/, spacing/)
|
| 28 |
-
- 💾 **No Data Loss** - Your original file remains unchanged
|
| 29 |
-
- 🆓 **Completely Free** - No credits needed, no limitations
|
| 30 |
-
|
| 31 |
-
## 📁 Project Structure
|
| 32 |
-
|
| 33 |
-
```
|
| 34 |
-
design-token-creator/
|
| 35 |
-
├── manifest.json # Plugin configuration
|
| 36 |
-
├── src/
|
| 37 |
-
│ └── code.js # Main plugin code
|
| 38 |
-
├── ui/
|
| 39 |
-
│ └── ui.html # Plugin interface
|
| 40 |
-
├── INSTALLATION.md # Installation guide
|
| 41 |
-
└── README.md # This file
|
| 42 |
-
```
|
| 43 |
-
|
| 44 |
-
## 🔧 Installation
|
| 45 |
-
|
| 46 |
-
See [INSTALLATION.md](./INSTALLATION.md) for detailed setup instructions.
|
| 47 |
-
|
| 48 |
-
### Quick Install
|
| 49 |
-
|
| 50 |
-
1. Clone or download this folder
|
| 51 |
-
2. In Figma: Plugins → Development → New plugin → Link existing plugin
|
| 52 |
-
3. Select this folder
|
| 53 |
-
4. Done!
|
| 54 |
-
|
| 55 |
-
## 📝 JSON Format
|
| 56 |
-
|
| 57 |
-
Your design tokens should follow this structure:
|
| 58 |
-
|
| 59 |
-
```json
|
| 60 |
-
{
|
| 61 |
-
"global": {
|
| 62 |
-
"colors": {
|
| 63 |
-
"teal": {
|
| 64 |
-
"value": "#00A09A",
|
| 65 |
-
"type": "color"
|
| 66 |
-
},
|
| 67 |
-
"hot-pink": {
|
| 68 |
-
"value": "#FF007F",
|
| 69 |
-
"type": "color"
|
| 70 |
-
}
|
| 71 |
-
},
|
| 72 |
-
"typography": {
|
| 73 |
-
"h1": {
|
| 74 |
-
"value": {
|
| 75 |
-
"fontFamily": "Montserrat",
|
| 76 |
-
"fontWeight": "700",
|
| 77 |
-
"fontSize": "48px",
|
| 78 |
-
"lineHeight": "1.2"
|
| 79 |
-
},
|
| 80 |
-
"type": "typography"
|
| 81 |
-
}
|
| 82 |
-
},
|
| 83 |
-
"spacing": {
|
| 84 |
-
"xs": {
|
| 85 |
-
"value": "8px",
|
| 86 |
-
"type": "spacing"
|
| 87 |
-
}
|
| 88 |
-
}
|
| 89 |
-
}
|
| 90 |
-
}
|
| 91 |
-
```
|
| 92 |
-
|
| 93 |
-
## 🎨 Example Usage
|
| 94 |
-
|
| 95 |
-
### Input JSON
|
| 96 |
-
```json
|
| 97 |
-
{
|
| 98 |
-
"global": {
|
| 99 |
-
"colors": {
|
| 100 |
-
"primary": { "value": "#0066ff", "type": "color" },
|
| 101 |
-
"secondary": { "value": "#ff007f", "type": "color" }
|
| 102 |
-
},
|
| 103 |
-
"typography": {
|
| 104 |
-
"heading": {
|
| 105 |
-
"value": {
|
| 106 |
-
"fontFamily": "Montserrat",
|
| 107 |
-
"fontWeight": "700",
|
| 108 |
-
"fontSize": "32px",
|
| 109 |
-
"lineHeight": "1.3"
|
| 110 |
-
},
|
| 111 |
-
"type": "typography"
|
| 112 |
-
}
|
| 113 |
-
}
|
| 114 |
-
}
|
| 115 |
-
}
|
| 116 |
-
```
|
| 117 |
-
|
| 118 |
-
### Output in Figma
|
| 119 |
-
- **Color Styles**: `colors/primary`, `colors/secondary`
|
| 120 |
-
- **Text Styles**: `typography/heading`
|
| 121 |
-
- All automatically available in your Assets panel!
|
| 122 |
-
|
| 123 |
-
## 🛠️ How It Works
|
| 124 |
-
|
| 125 |
-
1. **Parse JSON** - Plugin reads your design tokens
|
| 126 |
-
2. **Validate** - Checks for correct format and values
|
| 127 |
-
3. **Create Styles** - Generates Figma styles for each token
|
| 128 |
-
4. **Apply** - Adds styles to your document
|
| 129 |
-
5. **Confirm** - Shows success message with count
|
| 130 |
-
|
| 131 |
-
## 💡 Tips
|
| 132 |
-
|
| 133 |
-
- Use consistent naming conventions in your JSON
|
| 134 |
-
- Test with a small set of tokens first
|
| 135 |
-
- Keep your JSON file organized by category
|
| 136 |
-
- Update tokens regularly as your design system evolves
|
| 137 |
-
- Share the JSON file with your team for consistency
|
| 138 |
-
|
| 139 |
-
## 🐛 Troubleshooting
|
| 140 |
-
|
| 141 |
-
**Plugin won't load?**
|
| 142 |
-
- Check folder structure matches exactly
|
| 143 |
-
- Ensure manifest.json is in root folder
|
| 144 |
-
- Restart Figma
|
| 145 |
-
|
| 146 |
-
**Styles not created?**
|
| 147 |
-
- Verify JSON is valid (use jsonlint.com)
|
| 148 |
-
- Check token names don't have special characters
|
| 149 |
-
- Make sure hex colors are valid format
|
| 150 |
-
|
| 151 |
-
**Wrong style values?**
|
| 152 |
-
- Double-check JSON values
|
| 153 |
-
- Verify font sizes include "px"
|
| 154 |
-
- Ensure hex colors start with #
|
| 155 |
-
|
| 156 |
-
## 📚 Learn More
|
| 157 |
-
|
| 158 |
-
- [Figma Plugin API Documentation](https://www.figma.com/plugin-docs/)
|
| 159 |
-
- [Design Tokens Format](https://design-tokens.github.io/community-group/format/)
|
| 160 |
-
- [Figma Styles Documentation](https://help.figma.com/en/articles/12453487-Styles)
|
| 161 |
-
|
| 162 |
-
## 🎯 What's Next?
|
| 163 |
-
|
| 164 |
-
After creating your styles:
|
| 165 |
-
|
| 166 |
-
1. Create components using these styles
|
| 167 |
-
2. Build design system documentation
|
| 168 |
-
3. Publish as a shared library
|
| 169 |
-
4. Share with your team
|
| 170 |
-
5. Keep tokens updated as system evolves
|
| 171 |
-
|
| 172 |
-
## 📄 License
|
| 173 |
-
|
| 174 |
-
This plugin is free to use and modify for your own projects.
|
| 175 |
-
|
| 176 |
-
## ✨ Credits
|
| 177 |
-
|
| 178 |
-
Created to help design teams implement design systems efficiently in Figma.
|
| 179 |
-
|
| 180 |
-
---
|
| 181 |
-
|
| 182 |
-
**Ready to get started?** See [INSTALLATION.md](./INSTALLATION.md) for step-by-step setup instructions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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