Figma Setup
How to set up your Figma file for optimal use with the generator
Figma Setup Guide
This guide will help you set up your Figma file correctly for both icon generation and theme variable management.
Access Token Setup
- Log in to your Figma account
- Go to Settings > Account Settings
- Scroll to Access tokens
- Click "Generate new token"
- Give it a name (e.g., "Flutter Generator")
- Copy and save the token securely
For Icons
-
Create a Dedicated Frame
- Name it clearly (e.g., "Icons")
- Set a consistent size (e.g., 24x24)
- Enable "Auto Layout" for better organization
-
Icon Components
- Create each icon as a component
- Use clear, descriptive names
- Keep icons monochrome
- Align to pixel grid
-
Naming Convention
icon/menu icon/search icon/notification
-
Finding IDs
- File ID: In the URL
https://www.figma.com/file/XXXXXX/...
- Node ID: Right-click frame > Copy/Paste as > Copy link
- File ID: In the URL
For Variables
-
Create Variable Collections
- Create a collection named "1. ✨Mapped"
- Add modes (e.g., "Light", "Dark")
- Organize variables by category
-
Variable Structure
colors/ ├── primary ├── secondary ├── background └── text/ ├── primary ├── secondary └── accent typography/ ├── body_size ├── heading_size └── font_family spacing/ ├── small ├── medium └── large
Icon Design
-
Vector Optimization
- Use simple paths
- Combine shapes when possible
- Remove unnecessary points
- Boolean operations should be finalized
-
Size and Alignment
- Use consistent artboard sizes
- Center icons in their frames
- Snap to pixel grid
- Use even numbers for dimensions
-
Color and Effects
- Keep icons monochrome
- Avoid complex gradients
- Minimize use of effects
- Convert strokes to fills when possible
Variable Management
-
Naming and Organization
- Use descriptive names
- Follow category hierarchy
- Keep naming consistent
- Use lowercase with underscores
-
Value Types
- Colors: Use RGBA values
- Numbers: Use pixel values
- Text: Use exact string values
-
Mode Configuration
- Set default mode
- Define all variables in each mode
- Use consistent value types
- Document any special cases
Icon Generation
-
Export Problems
- Ensure components are properly created
- Check frame constraints
- Verify node IDs are correct
- Use PDF export for complex icons
-
Quality Issues
- Check vector optimization
- Verify alignment to pixel grid
- Review boolean operations
- Ensure consistent sizing
Variable Export
-
API Access
- Verify Enterprise plan
- Check API permissions
- Validate access token
- Review collection setup
-
Value Mapping
- Check variable types
- Verify mode configurations
- Review naming conventions
- Validate hierarchical structure