Skip to content

Semantic Diff Rules

Overview

Whenever components, variants, or styles are synced from Figma, Grails uses its semantic Diff Engine to compare incoming specifications against the currently stored version.

Rather than treating every edit as a generic update, Grails classifies changes into two categories:

  • Major (Breaking Changes): Modifications that break contracts for consumers in code or existing designs.
  • Minor (Non-Breaking Changes): Additions, visual evolutions, and token adoptions that remain backward compatible.

1. Component Properties (Props)

Properties define the public contract of your components.

ChangeImpactSeverityWhy it matters
Property RemovedA property existed in the previous version but was deleted.MAJORConsumers in code and existing designs rely on this property name. Removing it breaks the interface.
Property RenamedA property was removed and replaced with a different name.MAJORConsumers querying the property by its former name fail to find it.
Type ChangedThe data type of a property changed (e.g., from Text to Boolean).MAJORIncompatible data type breaks code typings and component configurations.
Dropdown Option RemovedAn allowed option in an enum/variant property was deleted.MAJORAny design or code instance using that option (e.g., size="compact") no longer resolves.
Property AddedA new property was added with default settings.MINORAdditive: existing call sites and instances continue working without changes.
Dropdown Option AddedA new option was added to an existing dropdown.MINORAdditive: existing values stay valid.
Default or Config ChangedThe default initial value or property config was modified.MINORSafe update: does not break existing contracts or alter explicit selections.
Prop Token Bound / UnboundA property default was linked to or unlinked from a design token.MINORA prop default is an initial value consumers can override; changing its binding does not break call sites.

2. Anatomy and Internal Structure

Anatomy tracks nested layers, instances, and dynamic prop bindings inside a component.

ChangeImpactSeverityWhy it matters
Sub-component SwappedA nested component instance was replaced with a different component.MAJORChanges the structural contract and props of the nested component.
Layer RemovedAn internal structural layer was deleted.MAJORConsumers or parent instances targeting or overriding that layer lose their reference.
Visibility Prop UnboundAn element whose visibility was controlled by a boolean prop stops following it.MAJORConsumers lose control over conditional display.
Text Content Prop UnboundA text layer whose content was driven by a prop stops following it (becomes static text).MAJORConsumers lose the ability to pass dynamic text to that layer.
Layer AddedA new nested layer or instance was introduced.MINORAdditive internal structure.
Layer ModifiedInternal structure moved without changing what the component nests or exposes.MINORStructural refinement with no contract impact.
Visibility / Content BoundA layer gained dynamic visibility or text content controlled by a prop.MINORAdditive capability: existing instances keep rendering their default state.

3. Variant Configurations

Variants represent the combinatorial states and configurations of a component set.

ChangeImpactSeverityWhy it matters
Variant RemovedA specific variant configuration (e.g., size=lg, state=disabled) was deleted.MAJORAny design or code instance referencing that exact configuration cannot resolve it.
Variant ModifiedThe visual styling, dimensions, or layout of an existing variant changed.MAJORModifying an existing variant changes what consumers see without opting in.
Variant AddedA new combination was added to the variant matrix.MINORAdditive: expands available options while existing configurations keep resolving.

4. Styles and Design Tokens

Grails evaluates visual styles and enforces design token integrity.

ChangeImpactSeverityWhy it matters
Token RegressionA style previously bound to a design token was unlinked, falling back to a raw value. It counts when only part of the value loses its token too, such as one side of a padding or one corner of a radius.MAJORUnlinking breaks design system discipline: the style stops following themes and modes, affecting all consumers with no way to opt out.
TokenizedA raw style value was linked to a design token.MINORAdopting a token is a design system improvement, not a break.
Visual Style AdjustedA color, spacing, or visual value changed while maintaining its token or presence.MINORControlled visual evolution.
Style Added or RemovedA style property was added or removed without breaking component references.MINORVisual style refinement.
Inherited Token Value ChangeA token referenced by the component changed its underlying value in a mode.MINORVisual update inherited from the token library; the component binding itself remains intact.