Skip to content

v1.15.0 — Variables (design tokens) CRUD

Choose a tag to compare

@BenKalsky BenKalsky released this 07 Jul 00:44
· 54 commits to main since this release
a036779

Elementor v4 Variables (design tokens) CRUD — 6 tools

The second plank of the v4 design-system parity work (after Global Classes CRUD in v1.14.0). Six MCP tools to author Elementor 4 Variables — the global color/font/size tokens that Global Classes and atomic styles reference.

Tool
list-variables active tokens in public shape {id,type,label,value,order}
get-variable one token by id
create-variable label + type (color/font/size) + value
edit-variable label/value in place, id preserved
delete-variable soft delete (tombstoned)
restore-variable un-delete — a capability the Novamira reference lacks

Built against Elementor's actual source

Writes go through Elementor's canonical Variables Repository (the REST backend) on the active kit's _elementor_global_variables meta, so token records, uniqueness/limit enforcement (1000 cap) and tombstone shape (deleted + deleted_at) match the editor exactly. Registers only when the repository is present AND the e_variables + Atomic Widgets experiments are active. Writes manage_options, reads edit_posts.

Hardened across the subsystem's real semantics:

  • CSS-injection safe — labels constrained to a CSS-ident slug; values reject ;{}< and /* */ (Elementor emits them raw into the kit's :root { --label:value }).
  • Pro-gated size — size tokens require Elementor Pro (the service filters global-size-variable on Free), enforced on create/restore and hidden from list/get/edit on non-Pro.
  • Custom-size expressionsclamp()/calc() stored in the atomic custom-size shape so they survive a native Variables Manager round-trip (a raw string would be silently re-parsed and lost).
  • Prop-array values — tokens created via the editor store prop-typed arrays; reads unwrap them to public scalars (#abcdef, 24px) instead of blobs.
  • Legacy tombstonesdeleted_at-only rows are treated as deleted everywhere and normalized before create/edit/restore.

Converged over 15 Codex review rounds (18 verified fixes, 0 false positives). Suite: 598 tests green.