Documentation in Figma
Figma’s description fields are often ignored by designers, but they can influence generation. The idea is simple. When intent is written down, AI has fewer gaps to fill with assumptions.
Include in the description:
Clear documentation reduces ambiguity and improves the predictability of generated components.
Explicit props, states, and default values
Use Figma’s properties panel to define variants and their values.
| Property | Type | Values | Default |
|---|
| Size | Enum | small, medium, large | medium |
| Variant | Enum | primary, secondary, ghost | primary |
| State | Enum | default, hover, active, disabled | default |
| ShowIcon | Boolean | true, false | false |
| IconPosition | Enum | left, right | left |
The instructions file as a bridge
The .github/copilot-instructions.md file is where you document project-specific standards, including SDC structure, CSS patterns, and Twig or YAML conventions.
This file acts as a translation layer between design logic and implementation standards. It ensures that generation aligns with the architectural decisions of the project.
Visual Constraints That Prevent Fragile CSS
Some design decisions seem harmless but create long-term issues in code.
Best practices
Prioritize Auto Layout with gap
Avoid absolute positioning
Use Fill and Hug intentionally
Define fixed widths only when necessary
Limit text by the number of lines in the design
Common problems
Elements without a parent container
Negative margins used for alignment
Breakpoints without clear rules
Components that only work with specific content
Pillar 3 – Iteration
How to refine until you reach the ideal result
Even with a solid structure in Figma and clear communication of layout intent, the first output generated through Drupal Canvas will rarely be final. This is not a flaw in the process. It is a natural part of any component-driven workflow.
The difference between a team that becomes frustrated with automation and a team that scales with it lies in how iteration is handled. Good iteration does not mean fixing code. It means refining the input that generates the code.
In this pillar, the focus is on understanding how to evolve components in a controlled and predictable way without compromising system consistency.
Iterate by component, not by page
Testing directly within full pages often creates confusion. On a page, multiple components interact at once. When something breaks, it becomes difficult to trace the source. You do not know whether the issue comes from the card, the grid, the slot, the token, or a specific variant.
The ideal approach is to work in short, controlled cycles at the component level:
Generate an isolated component
Validate structure, props, and slots
Adjust the design in Figma if the issue is structural
Regenerate the component to confirm behavior
Only then use the component to compose pages
This method reduces the impact of errors because you fix the root cause before it spreads across the interface. It also accelerates learning, since each iteration produces clear feedback about what changed in Figma and how it appeared in Canvas.
Other content about Drupal:
The Fast Feedback Cycle
An efficient workflow between Figma and Drupal Canvas depends on short, repeatable, and predictable cycles. The logic is simple: generate, test, evaluate, and adjust, without long intervals between each step. The shorter the cycle, the less rework.
1. Generate
Run component synchronization by providing the component name and the exact node URL in Figma. This step creates the base of the component in Canvas from the defined design structure.
2. Test
After generation, clear the cache and preview the component in the Canvas editor. The goal is not to validate aesthetics, but to confirm that the component renders correctly and is available in the environment.
3. Evaluate
Perform an objective technical quality check:
Semantic HTML structure
Consistent CSS class patterns
Use of CSS variables instead of fixed values
Props correctly mapped
Functional responsiveness
Interaction states implemented
Basic accessibility requirements met
4. Adjust
If something is not correct, refine and repeat the cycle.
Adjust in Figma and regenerate when the issue is structural, such as hierarchy or naming.
Adjust directly in code when the issue is isolated, modifying YAML, Twig, or CSS.
This cycle reduces late-stage corrections, keeps design and code aligned, and transforms component generation into a predictable, technical, and controlled process.
Discover how to apply it to your project
When the output is good enough
Pursuing absolute perfection can delay the project without delivering proportional value. In the Figma to Drupal workflow, the goal is not to eliminate every minor imperfection, but to ensure the component is solid, reusable, and consistent with the system. Knowing how to prioritize is what preserves speed without compromising quality.
Low-impact issues can be accepted or resolved with quick adjustments. Structural problems should be corrected in Figma and regenerated to prevent the error from spreading. Experience or accessibility issues, however, are non-negotiable and require immediate correction. This balance keeps the workflow healthy and productive.
| Problem | Impact | Action |
|---|
| CSS class with an odd name | Low | Accept or apply a quick manual fix |
| Incorrect HTML structure | High | Adjust in Figma and regenerate |
| Missing state such as hover | Medium | Add manually |
| Props not mapped | High | Review the component description in Figma |
| Broken responsiveness | High | Review Auto Layout in Figma |
| Inconsistent spacing | Medium | Check tokens or adjust manually |
Designer and developer in sync
The Figma to Drupal workflow does not eliminate collaboration between design and development. It makes it more objective. Instead of long translation cycles and rework, the process focuses on quick validations and joint decisions based on the component’s real behavior.
This proximity reduces noise, accelerates delivery, and creates shared understanding around technical constraints and design possibilities.
Establish a simple ritual:
The designer prepares the component in Figma following the agreed standards
The developer runs the generation and tests it in Canvas
Together, they review the result in a quick call lasting 15 to 30 minutes
They decide jointly whether to accept it, adjust in Figma, or adjust in code
This rhythm keeps iteration structured and prevents misalignment from accumulating.
Bidirectional Feedback: When code informs design
The workflow is not just Figma to Code. In many cases, code reveals limitations or opportunities that were not obvious in design. Auto Layout that does not generate consistent Flexbox, deeply nested hierarchies that produce complex CSS, or poorly defined slots that limit reuse are common examples.
When this happens, adjusting Figma does more than improve the current component. It improves the entire system that will be generated from it.
Shared documentation is the foundation of the process
For iteration to scale and not rely solely on team memory, it is essential to record decisions. A simple document in Notion, Confluence, or Google Docs is enough to support the process.
Document the component library and its status, agreed naming, token and structure standards, relevant technical decisions, and known issues with their solutions. This reduces rework and keeps the team aligned over time.
Common errors in the Figma to Drupal workflow and how to avoid them
Structural issues
When a component does not appear in Canvas, the cause is usually an uncleared cache. Overly generic HTML typically indicates layers without semantic names. Strange CSS is often the result of deeply nested hierarchies. Missing props almost always originate from incomplete descriptions in Figma.
| Problem | Likely Cause | Solution |
|---|
| Component does not appear in Canvas | Cache not cleared | Run ddev drush cr after each generation |
| Generated HTML uses generic div elements | Layers lack semantic names | Rename all layers in Figma |
| CSS selectors look unusual | Layer structure too deeply nested | Simplify hierarchy to a maximum of 4 to 5 levels |
| Props do not appear in the panel | Incomplete component description | Document all props in the Figma description |