Skip to content

data_whtml_builder silently creates duplicate styles, corrupting the Designer canvas while published output stays correct #142

Description

@susflow

Summary

A single data_whtml_builder call that inserts two bare <span> elements into a Rich Text created 59 duplicate styles site-wide. The published site remained pixel-correct, but the Designer canvas and Preview were broken on every page — all grid layouts collapsed. Because the published output was unaffected, the corruption was invisible to every normal verification step.

Environment

  • Webflow MCP Server (via Claude Code, webflow-skills plugin v1.0.6)
  • Site built on the Lumos framework (container-query based responsive system)
  • Date observed: 2026-07-08

Steps to reproduce

  1. Open a site whose classes already exist (e.g. a Lumos/Client-First template with u-container, u-grid, u-layout, u-section …).
  2. Call data_whtml_builder targeting a Rich Text paragraph inside a component instance's rich-text prop override:
{
  "build_label": "insert span",
  "parent_element_id": { "component": "<pageId>", "element": "<paragraphId>" },
  "creation_position": "prepend",
  "html": "<span>hello</span>"
}

No css parameter is passed. The HTML is a single root element and contains no <style> tag, i.e. it satisfies every rule the webflow_guide_tool documents.
3. Observe the returned element: {"type":"Span","settings":{"visibility":true}} — no styleNames, nothing suspicious.
4. Check Site settings → Backups. The style count has jumped.

Actual result

  • Style count went from 1077 → 1136 (+59), per Webflow's own Backups dialog.
  • The new styles are -2 / -3 suffixed clones of the existing class names, bound to zero elements:
u-container-2   u-grid-2   u-grid-wrapper-2   u-layout-2   u-layout-wrapper-2
u-layout-column-1-2   u-layout-column-2-2   u-section-2   u-section-spacer-2
u-heading-2   u-text-2   u-button-wrapper-2   u-eyebrow-layout-2   guide_layout-2
card_primary_*-2   button_main_*-2   clickable_*-2 …

That set is precisely the layout/grid style dependency stack of the insertion context.

  • Designer canvas and Preview broke on every page of the site, including pages that contain neither the inserted element nor the component it lives in.
  • Published output stayed completely correct — the orphan rules are emitted into the stylesheet but applied to no element.
  • Deleting the inserted <span> elements did not fix the Designer. The styles persist independently of the elements.
  • Restoring a backup taken before the call fixed it immediately.

Expected result

Inserting a classless <span> should create zero styles. At minimum, the tool should not clone existing class definitions under -2 / -3 names, and any style creation should be reported in the tool response.

Why this is severe

  1. Silent. The tool response gives no hint that 59 styles were created.
  2. Global. A page-scoped call mutates the site-wide style registry.
  3. Invisible to normal verification. Checking the published HTML/CSS — the obvious way to confirm a change worked — shows a perfectly healthy site. Only the Designer is broken.
  4. Not reversible by undoing the element. Removing the inserted node leaves the styles behind.
  5. Undocumented. webflow_guide_tool documents the tool's HTML/CSS rules (single root element, no <style> tags, allowed media queries) but never mentions that it creates styles.

Suspected mechanism

data_whtml_builder appears to serialize the insertion point's style context into a WHTML clipboard payload. Webflow's paste importer then encounters class names that already exist and creates deduplicated copies.

Why the Designer breaks but publishing does not is a hypothesis, not a verified claim: this site's entire responsive system consists of @container rules that live only in a Global Styles HTML embed, keyed off container-type: inline-size carried by .u-grid-wrapper:where(.w-variant-…). The compiled stylesheet contains zero @container rules. If the canvas resolves u-grid-wrapper to the duplicate style — which carries no container-type — no container query ever matches, and every grid falls back to desktop defaults.

Suggested fixes

  • Do not create styles for elements that carry no class.
  • Never silently clone an existing class under a -2 name; either reuse the existing style or fail loudly.
  • Return the list of created styles in the tool response.
  • Document the style side effect in webflow_guide_tool, and state that the tool is intended for greenfield structure, not for edits inside existing styled contexts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions