03 — Language System
Primitive Types
IDL defines seven primitive types: Color, Dimension, Duration, Number, String, Boolean, and Enum. All token values MUST resolve to one of these seven primitive types. Composite types are defined as structured records of primitives. No custom primitive type may be introduced without a grammar-level specification change.
Primitive Type Definitions
| Type | Value Domain | Example |
|---|---|---|
| Color | sRGB hex, named color references, or platform-declared color space tokens | #3B82F6 · oklch(60% 0.2 240) |
| Dimension | Non-negative number with unit: px, rem, % | 8px · 1rem · 50% |
| Duration | Non-negative number with unit: ms, s | 200ms · 0.2s |
| Number | Rational number, positive or negative | 1.5 · -0.5 · 0 |
| String | UTF-8 string literal | "Inter" · "sans-serif" |
| Boolean | true or false | true · false |
| Enum | Named member of a declared enumeration | density.compact · easing.linear |
Type Coercion
IDL does not perform implicit type coercion. A token declared as type Color MUST be assigned a Color value; assigning a String value that happens to contain a valid hex code is a Transform error. Type declarations are strict. This eliminates a class of ambiguities where the same string could be interpreted differently by different emitters or consumers.
Composite Types
Composite types are named structures composed of primitive types. The typography scale tuple (size: Dimension, weight: Number, lineHeight: Number, letterSpacing: Dimension) is a composite type. Composite types are declared in the IDL system schema; they cannot be declared inline in module files. The compiler validates composite type conformance during Transform.