EN, Change language
Englishالعربية
Criterion 4 · FoundationsMachine-measured

Ensure spacing values are applied according to the Unified Design System (Platforms Code)

Every margin and padding value must sit on the approved spacing scale and be written as a variable rather than a raw number. Off-scale values such as 15, 18 or 22 pixels are the residue of accumulated hand-building, not a design decision.

It is one of the primary criteria in the foundations group of the Saudi Platforms Code, issued by the Digital Government Authority.

How xfix gov measures this criterion

The applied value is read from the page and compared with the value approved in the Platforms Code, so the verdict comes from a measurement rather than an estimate, and the observed and expected values are attached together.

The official text and its checkpoints

This criterion rests on 2 checkpoints published in the Platforms Code, and they are the reference when judging it.

This criterion on the official Platforms Code site

The checkpoints, one by one

Each checkpoint below has its own answer: what it requires, what passes and what fails, how it is measured or verified, and how it is repaired. Each has a direct link.

  1. Approved spacing units (4, 8 and 16 pixels)

    Machine-measuredDGA-004-a

    This checkpoint requires every spacing value between elements to come from the approved scale, a set of specific values (2, 4, 6, 8, 12, 16 up to 160 pixels) rather than every multiple of four. A value off the scale is a violation even when it looks balanced on screen.

    xfix gov measures this checkpoint automatically, and attaches the observed value and the expected value together.

    What passes: Every margin and padding value on the page sits on the approved scale and is written as a variable rather than a literal number.

    What fails: Values such as 15, 18 or 22 pixels scattered through the stylesheet, the residue of accumulated hand-building rather than a design decision.

    How it is measured or verified: The tool counts every spacing value on visible elements, leaving out the automatic margins that centre a container, and separates those on the scale from those off it, reporting once per value with its usage count. One measurement on a university platform found 42 off-scale values across 581 usages: 42 rules to fix, not 581 violations.

    How it is repaired: Replace off-scale values with the nearest value on the scale, starting with the most-used. The work here is counted in rules, not elements.

  2. Global spacing variables, no component-specific overrides

    No rule built yetDGA-004-b

    This checkpoint requires the global spacing variables of the Platforms Code, and forbids custom spacing inside components. The difference is that a global variable stays connected to the library while a custom value detaches from it.

    No rule in the tool reads this checkpoint yet, so the scan counts it neither for nor against.

    What passes: Spacing is written with global variables everywhere, and components called from the library keep their internal spacing untouched.

    What fails: Overriding a component’s internal spacing with a special value to fix an alignment on one page, which detaches that instance from the library so updates never reach it.

    How it is measured or verified: Spacing declarations in the style sheets the page allows reading are read, separating variable-written declarations from literal ones, and the share is reported as a note outside the verdict, because style sheets from other domains cannot be read. So this checkpoint is verified by your own team.

    How it is repaired: Return custom spacing to the global scale variables and solve the alignment in the container rather than inside the component.

Related criteria

xfix gov is an independent tool, not part of the Digital Government Authority, and what it produces is an indicative estimate, not the Platforms Code Application Certificate. The limits of this tool.

Spacing: Platforms Code criterion 4 | xfix