Get clean conversions by writing (or prompting for) clean code

The Converter works best when the input follows a few simple conventions. Here’s what those are, why they matter, and a ready-to-use prompt that gets AI tools to produce exactly the right kind of code.
Works with
  • Webflow
  • Figma

These rules are written for Convert to Webflow. Convert to Figma takes HTML and CSS only, so the JavaScript and animation advice does not apply to it. The Converter can handle a wide range of HTML, CSS, and JavaScript. But the closer your code follows a few standard conventions, the more of it lands as native Webflow elements instead of as embedded code. Sections written with these patterns convert quickly, look right in the Designer, and need almost no cleanup afterward.

‍

The patterns that convert best

These are the patterns the Converter is built around. Code that follows them produces the cleanest possible Webflow output:

  • Vanilla HTML and CSS. No CSS-in-JS, no styled-components, no framework-specific markup. Just standard HTML elements with class-based styling.
  • REM units instead of pixels. REM gives you responsive scaling for free and matches how Webflow’s class system thinks about sizing.
  • BEM-style class names. Descriptive, hyphenated class names like card, card__header, card--featured. These map cleanly onto Webflow’s class system.
  • Class-only styling. Style everything via classes — not tag selectors (h2 { ... }) or ID selectors (#hero { ... }). Webflow’s class system has no concept of tag-based styles, so anything written that way ends up embedded as custom CSS.
  • Simple selectors. Single-class selectors are ideal. Avoid descendant selectors (.card .title), child selectors (.card > .title), or complex chains.
  • Named classes over long utility chains. Tailwind is detected and compiled automatically, so it converts. Named BEM classes still give you tidier classes to edit in Webflow.
  • No complex pseudo-selectors. :hover, :focus, and :active work great. :nth-child(odd), :not(:first-of-type), and exotic combinators don’t always have native Webflow equivalents and may end up embedded.

If you’re writing code yourself, follow these by hand. If you’re generating with AI, use the prompt below.

‍

The example AI prompt

This is the prompt we recommend handing to your AI tool when you want code that converts well. It’s also visible on the Converter page itself, so you can copy it from there anytime.

Prompt
Write vanilla HTML and CSS using REM units instead of PX, BEM-style class naming, class-only styling (no tag or ID selectors), no descendant selectors, simple selectors only, minimal utility classes, no complex pseudo-selectors.

Come up with a [SECTION TYPE] section for [YOUR PROJECT]. Add smooth animations using GSAP. Only use free GSAP plugins (ScrollTrigger, Flip, Observer, ScrollTo, Draggable, MotionPathPlugin, EasePack, CustomEase).

Replace [SECTION TYPE] with what you want (a pricing section, a hero, a testimonial row, etc.) and [YOUR PROJECT] with a short description of the brand or product. The first paragraph sets the technical rules. The second paragraph tells the AI what to build.

This prompt works in Claude, Lovable, v0, Cursor, and any other AI tool or AI chat that can generate HTML. Drop it in, fill in the brackets, and the output should convert with very little extra work.

‍

Pairing the prompt with a Design System

The prompt above gives you technically clean code. To get code that also follows the visual style of a BYQ template, combine it with a Design System:

  1. Open your AI tool.
  2. Attach a Design System’s DESIGN.md file from BYQ.
  3. Paste the example prompt above, filled in with your section type and project.

The Design System tells the AI how it should look. The prompt tells the AI how it should be coded. Together you get a section that’s both visually polished and technically clean — ready for the Converter to bring into Webflow as native elements.

‍

A note on animations

The example prompt includes GSAP because GSAP is the most reliable way to get sophisticated, smooth animations out of AI tools. The trade-off is that GSAP-driven motion lands as a JS Embed in Webflow (as covered in How the Converter works), so it won’t render in the Designer and isn’t editable via Webflow’s interactions panel.

If you’d prefer to avoid JavaScript libraries, you can swap that line for something like:

Prompt
Use CSS transitions and keyframe animations only — no JavaScript animation libraries.

The result is simpler motion with no script. CSS @keyframes land in a CSS Embed, not as native Webflow styles.

‍

What to avoid

A short list of things that consistently produce embeds instead of native elements:

  • Framework markup (React, Vue, Svelte components) — paste only the rendered HTML, never the component source
  • Inline styles (style="..." on elements) — these come through as overrides instead of class-based styles
  • Heavy JavaScript dependencies beyond GSAP — most other animation libraries embed as code with no native equivalent
  • <canvas> and WebGL content — these embed as-is and aren’t editable in Webflow

None of these will break a conversion. They just produce more custom code embeds and less editable Webflow structure.

‍

Why this matters

Code that follows these patterns converts in seconds and gives you a Webflow section you can edit normally. Code that doesn’t follow them still converts — it just produces more embedded blocks and more cleanup work after. Spending a moment on the prompt before generating saves you that cleanup later, every time.

How to paste a converted section into Webflow and Figma — including the fresh-project safety pattern.