N2-03 · The Config-First Paradigm
Context
In most design systems, Figma is the starting point. The designer chooses colors, defines styles, organizes the library. The developer then translates those decisions into code.
In Aplica DS, the flow is inverted. This tutorial explains why that inversion exists, what it changes in practice, and which decisions still belong to Figma.
Concept
The problem with Figma as the source of truth
When Figma is the source of truth, there is a structural problem: any decision made in Figma must be manually translated to every other context — code, mobile, email, documentation.
If the primary color changes in Figma, someone needs to update the code. If the code is updated without going through Figma, Figma falls out of date. Which is correct? The honest answer is: nobody knows for sure.
Moreover, Figma knows nothing about dark mode, multi-platform, or multi-brand. You can have a manually created dark version, a mobile version that is an independent copy, and tokens that have silently diverged over months.
The inversion: code as the source of truth
In the Config-First paradigm, the design decision starts in the theme configuration file (*.config.mjs). There you declare:
- Brand colors (one hex per semantic role)
- Typography (font families and weights)
- Pipeline options (txtOn strategy, dark mode saturation)
The engine reads that file and automatically generates:
- All layers (Brand → Mode → Surface → Semantic → Foundation)
- All output formats (CSS, JSON for Figma, JS modules, TypeScript)
- All themes (light/dark × positive/negative)
Figma receives the tokens via JSON — it does not create the tokens. It consumes them.
What this changes in practice
| Before (Figma as source) | After (Config-First) |
|---|---|
| Designer chooses colors in Figma | Designer declares the color in the config |
| Dev "translates" Figma to code | Dev loads the CSS generated by the engine |
| Dark mode created manually | Dark mode generated by the pipeline |
| Multiple brands = multiple Figmas | Multiple brands = multiple configs |
| Gradual inconsistency guaranteed | Mathematical consistency guaranteed |
What Figma still decides
The inversion does not mean Figma loses relevance. It is still the right space for:
- Composition and layout — how components are organized on screen
- Visual hierarchy — which elements are more prominent
- Flow and navigation — the sequence of screens and states
- Prototyping — simulating interaction before implementation
- Component specification — documenting the behavior of new components
Figma is the space for compositional decisions. The config is the space for visual identity decisions.
Guided example
Simulating a brand color change
Imagine the client decides to change the primary action color from #C40145 to #D01050.
In the old paradigm:
- Designer opens Figma, changes the color style
- Exports a report of affected components
- Dev updates the variable in CSS
- Dev updates the variable in React Native
- Dev updates the token in the email JSON
- Someone checks dark mode (probably forgets)
- Weeks later: some product still has the old color
In the Config-First paradigm:
- System Designer opens
*.config.mjsand changes the hex foraction_primary - Runs
npm run build:themes - Figma receives the new JSONs and updates automatically
- CSS, ESM, CJS, and TypeScript are generated with the new values
- Dark mode, multi-brand, mobile — everything regenerated
One change, one place, all consequences calculated.
The complete cycle of a design decision
1. DECISION
System Designer declares in config:
"The primary action color for this brand is #D01050"
2. GENERATION
npm run build:themes
Engine generates: full palette, dark mode, neutrals, all formats
3. DISTRIBUTION
JSON → Figma (via Tokens Studio)
CSS → Web
ESM → React / Vue
CJS → Node.js
JSON → Documentation
4. CONSUMPTION
Figma: designer applies tokens to components
Web: dev uses var(--semantic-color-*)
Mobile: dev uses values from ESM
5. VALIDATION
Product Designer verifies in Figma
Engineer verifies in browser
If something needs to change → back to step 1
Now you try
Identify, for each decision below, where it should be made in the Config-First paradigm:
- The "Save" button color is too dark — needs to be lighter
- The spacing between home cards is too tight
- A new product wants to use green as its brand color
- The error alert needs a more intense red tone (secondary)
- The page title has the wrong font
- It was discovered that the badge component's dark mode has a hardcoded hex
Expected result:
| Decision | Where to resolve |
|---|---|
| Button too dark | Config (txtOnStrategy or color mapping) — it is an identity decision |
| Tight spacing | Figma (composition) → if persistent, config (Dimension scale) |
| New green brand color | Config — new *.config.mjs for the new product |
| More intense red tone | Config — adjust the hex for danger_secondary |
| Wrong title font | Config — typography.fontFamilies.main |
| Hardcoded hex in badge | Component code — refactor to use Semantic token |
Checkpoint
By the end of this tutorial you should know:
- Why Figma as the source of truth creates synchronization problems
- What Config-First means: the config is the origin, Figma is the consumer
- The complete cycle: declaration in config → build → distribution → consumption
- Which decisions still belong to Figma (composition, flow, prototyping)
- How to trace a color change from config to Figma
Next step
N2-05 · Product colors — responsible growth
You understand the paradigm and the pipeline. The next step is to learn about the most dangerous area of the system: product colors. Why does each new product color cost much more than it seems?
References
- The Config-First paradigm: 02-designer-workflow.md
- What is the Theme Engine: 01-what-is-theme-engine.md
- Build pipeline: 04-build-pipeline.md