Skill 28 · Wix Headless Replatform
Subchapter 28.9
references/ui-normalization-contract.mdMarkdown3 KBView on GitHub
Use this contract after page sections and interaction scenes are extracted. It improves implementation quality inside the source design; it is not a redesign step.
Scripts
scripts/36 filesIdentity locks always outrank best-practice rules. Preserve:
Allowed normalization includes local spacing/alignment, repeated-item consistency, responsive reflow inside the same archetype, subtle hover/focus feedback, eased state transitions, accessibility, and reduced motion.
ui-normalization.json is the machine-readable source of truth.
ui-normalization.md is its compact implementation view. Load the neutral primitives once:
<link rel="stylesheet" href="/site-clone/rp-ui-normalize.css">Each section must use its exact data-rp-section and data-rp-layout markers. Repeated
components use data-rp-item, data-rp-media, data-rp-body, and data-rp-action as
declared. Use data-rp-motion="micro" for hover/focus feedback and
data-rp-motion="state" for click/activation transitions.
When source evidence says peer cards share a height:
data-rp-equal-height="true" on the collection;--rp-item-block-size to the extracted shared height;Do not solve long content by hiding source text. Reflow or adjust internal regions while keeping peer geometry and content intact.
Hover and focus are micro-interactions. Prefer color, shadow, opacity, or a small transform; do not unexpectedly reflow siblings. Click and activation may expand a card, reveal a panel, or scroll only when the interaction contract requires it.
Captured transition timing overrides defaults. Without captured timing, micro motion uses
140–240ms and state motion uses 240–600ms with eased timing. Rapid actions may cancel an
animation, but final semantic state, focus, and content must remain correct. A
prefers-reduced-motion rule must expose that final state without non-essential interpolation.
verify-interactions.mjs reads the normalization contract when present. Its report checks:
Fix every failed normalization check before reporting completion.