webflow-css-preservation

A migration rule for Webflow sites, which are websites built with Webflow's visual design tool. It keeps the exported CSS and class names unchanged while the site is moved to another codebase.

In plain words
What is it for?
Use it when converting Webflow HTML into JSX or another frontend implementation and matching the original appearance.
Why use it?
It reduces visual differences caused by rewriting styles too early. It preserves the original layout while the migration is being checked.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/dmenchaca/webflow-to-react/webflow-css-preservation
Clone the repo
git clone --depth 1 https://github.com/dmenchaca/webflow-to-react
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 585 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00585
Opus 5 $0.00000 $0.00293
Sonnet 5 $0.00000 $0.00117
Haiku 4.5 $0.00000 $0.00059

Measured 2d ago against content hash 72a7327e7182, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

webflow-css-preservation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/webflow-css-preservation.mdc · 34 lines

How it starts

The opening of the file, as written. The whole thing — 34 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Preserve Webflow's CSS and class names

This project migrated from a Webflow HTML export. The fastest path to pixel parity is to keep Webflow's compiled CSS and class names verbatim and only refactor later, section by section.

Do

  • Put Webflow class names on JSX verbatim (className="hero-section_wrapper", underscores and all).
  • Keep the compiled Webflow CSS split under src/styles/marketing/ (normalize.css, layout-components.css, <brand>.css, etc.).
  • marketing.css @import order: site-fonts.css first, then normalize/layout/compiled <brand>.webflow.css, then any global-embed.css (or similar) copied from index.html <style> blocks. Embeds usually define .hide and must load after the site bundle — otherwise hidden Designer nodes become visible. See gotchas.md § Designer-hidden nodes: .hide and stylesheet order.
  • Rewrite asset URLs in copied CSS to root-relative: url("/images/..."), url("/fonts/...").
  • When in doubt, diff against the root-level index.html (Webflow reference — read-only).

Don't

  • Don't translate Webflow breakpoints (479 / 767 / 991 px) to Tailwind screens while migrating. Leave the media queries inside the copied CSS.
  • Don't rename class names "to be cleaner" — it breaks parity and makes diffing against the reference impossible.
  • Don't start converting to Tailwind utilities across many sections at once. One section at a time, only after parity is confirmed.
  • Don't delete unused-looking rules from the compiled CSS during migration; Webflow CSS often cross-references many class combos.
  • Don't assume html-react-parser / raw HTML preserves behavior — only structure and styles. webflow.js, IX2, and w-* component JS still need a port or replacement. See gotchas.md § Raw html-react-parser and § Webflow webflow.js behaviors.

Progressive refactor path (post-parity)

  1. Confirm pixel parity on all breakpoints.
  2. Pick one section. Replace its JSX classes with Tailwind utilities.
  3. Move any still-needed custom CSS into a section-scoped class.
  4. Delete the now-dead rules from the compiled CSS.
  5. Repeat.

Read the full file on GitHub · 34 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 34 lines · 0 tokens per session scan A 72a7327e7182

Subscribe to this mod's changes

webflow-css-preservation is a cursor rule published in the GitHub repository dmenchaca/webflow-to-react (27 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 585 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.