Mapping Editor
The Mapping Editor helps you configure mapping.json files, which control how your CSS files target specific FM stylesheets.
What is Mapping?
By default, your CSS changes apply to no stylesheets across all bundles. Mapping lets you be more specific:
- Apply different colors to different parts of FM’s UI
- Target only certain stylesheets
- Avoid unintended changes
Example: You want blue colors in the main UI but green colors on match screens. Mapping makes this possible.
Opening the Mapping Editor
- Double-click
mapping.jsonin the Explorer - Create new: File > New File, save as
mapping.jsonin yourstyles/folder
Mapping Editor interface
Screenshot ID: mapping-editor-overview
Simple Mode
Simple Mode provides a visual interface for managing mappings.
Mapping Editor Simple Mode
Screenshot ID: mapping-simple-mode
Understanding the Interface
The editor shows:
- Your CSS files: Listed on the left
- Target stylesheets: Listed on the right
- Connections: Lines showing which CSS targets which stylesheets
Creating a Mapping
- Find your CSS file in the left column
- Click “Add Target”
- Select or type the stylesheet name
- The mapping is created
Creating a new mapping
Screenshot ID: mapping-create
Removing a Mapping
- Find the mapping connection
- Click the X button on the connection
- The mapping is removed
Multiple Targets
One CSS file can target multiple stylesheets:
CSS file with multiple targets
Screenshot ID: mapping-multiple
- Select your CSS file
- Click “Add Target” multiple times
- Add each stylesheet you want to target
Expert Mode
Expert Mode lets you edit the mapping.json directly.
Mapping Editor Expert Mode
Screenshot ID: mapping-expert-mode
Mapping Syntax
Basic (Single Target)
{
"my-file.uss": "FMColours"
}This means styles/my-file.uss only applies to the FMColours stylesheet.
Multiple Targets
{
"base.uss": ["FMColours", "UIStyles", "BaseStyles"]
}The CSS applies to all three stylesheets.
Object Syntax
For complex configurations:
{
"base.uss": {
"stylesheets": ["FMColours", "UIStyles"]
}
}Complete Example
{
"main.uss": ["FMColours", "UIStyles"],
"match.uss": "MatchColours",
"buttons.uss": ["UIStyles", "ButtonStyles"]
}How Mapping Works
Without Mapping
If you have styles/base.uss:
:root {
--primary: #ff0000;
}This changes --primary in no stylesheets.
With Mapping
With styles/mapping.json:
{
"base.uss": "FMColours"
}Now base.uss only changes --primary in the FMColours stylesheet.
Unmapped Files
CSS files not listed in mapping.json apply nowhere.
styles/
├── base.uss # Not in mapping → applies nowhere
├── match.uss # In mapping → applies only to MatchColours
└── mapping.jsonFinding Stylesheet Names
How do you know which stylesheets exist?
Use the bundle viewer or a community skin as a reference.
Common FM Stylesheets
| Stylesheet | Purpose |
|---|---|
FigmaGeneratedStyles | Main style class definitions |
FMColours | General colour styling |
FigmaStyleVariables | Main colour variable definitions |
SIStyles | Other styling |
FigmaGeneratedVariableStyles | Base/default styles |
Note: Actual stylesheet names may vary by FM version.
Workflow Example
Goal: Different colors for main UI vs match screens
Step 1: Create CSS files
styles/main.uss:
:root {
--primary: #3498db; /* Blue */
}styles/match.uss:
:root {
--primary: #27ae60; /* Green */
}Step 2: Create mapping
styles/mapping.json:
{
"main.uss": ["FMColours", "UIStyles"],
"match.uss": "MatchColours"
}Step 3: Build and test
- Main UI shows blue
- Match screens show green
Asset Mapping
Mapping also works for assets in graphics/icons/mapping.json and graphics/backgrounds/mapping.json, but with different syntax. See Texture Replacement.
Tips and Best Practices
Start Without Mapping
For simple skins, you may not need mapping:
- Use a single
base.ussfor global colours - Add mapping only when you need different colours in different places
Be Explicit
If you’re using mapping, map all your CSS files:
{
"base.uss": ["FMColours", "UIStyles", "BaseStyleSheet"],
"match.uss": "MatchColours",
"buttons.uss": "ButtonStyles"
}Document Your Strategy
In a README or comments:
Mapping Strategy:
- base.uss → Global colors (FMColours, UIStyles)
- match.uss → Match screen specific (MatchColours)
- buttons.uss → Button overrides only (ButtonStyles)Test Each Target
After creating mappings:
- Check that the right stylesheets were modified
- Test in FM that changes appear in expected places
Troubleshooting
”Mapping not applying”
- Check file is named exactly
mapping.json - Verify JSON syntax is valid
- Ensure CSS file names match exactly (case-sensitive)
- Confirm stylesheet names are correct
”Changes appearing everywhere”
- Your CSS file isn’t in mapping.json (unmapped = global)
- Add it to mapping.json to restrict targeting
”Changes not appearing anywhere”
- Stylesheet name might be wrong
- Check for typos in mapping.json
”JSON syntax error”
Validate your JSON:
// Common mistakes
{
"base.uss": "FMColours", // No trailing comma on last line
}
// Correct
{
"base.uss": "FMColours"
}Next: Table View Editor - Configure table layouts.