# org.designtxt.defs

> Published by [bomberstudios.com](https://lexicon.garden/identity/did:plc:34yvx4hv64znmh2i2fezoyqx)

✓ This is the authoritative definition for this NSID.

## Description

Shared type definitions for Design Tokens, based on DTCG 2025.10 stable specification. Defines scalar value types (color, dimension, duration, etc.) and composite value types (border, shadow, typography, etc.) used by token and resolver records.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:34yvx4hv64znmh2i2fezoyqx/org.designtxt.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:34yvx4hv64znmh2i2fezoyqx/org.designtxt.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:34yvx4hv64znmh2i2fezoyqx/org.designtxt.defs/examples)

## Definitions

### `org.designtxt.defs#colorStop`

**Type**: `object`

A single gradient color stop. Position is a string-encoded float.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `color` | `ref` → `#colorValue` | No | Color at this stop. |
| `position` | `string` | No | Stop position as a string-encoded float (0-1 for proportional, or unitless percentage like '50'). |

### `org.designtxt.defs#colorValue`

**Type**: `object`

A color value expressed in a specific color space with optional alpha and hex fallback. Float components are stored as strings because the atproto data model does not support floating-point numbers.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `hex` | `string` | No | 6-digit CSS hex fallback (e.g. #ff00ff). |
| `alpha` | `string` | No | Opacity as a string-encoded float between '0' and '1'. Assumed '1' if omitted. |
| `colorSpace` | `string` | Yes | The color space identifier. |
| `components` | `array` | Yes | Color component values (positional, depending on colorSpace). Each element is a string-encoded float (e.g. '0.4', '1.0') or the string 'none'. |

### `org.designtxt.defs#borderValue`

**Type**: `object`

A composite border value combining width, line style, and color.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `color` | `ref` → `#colorValue` | No | Border color. |
| `style` | `string` | No | Border line style. |
| `width` | `ref` → `#dimensionValue` | No | Border width. |

### `org.designtxt.defs#numberValue`

**Type**: `string`

A numeric value encoded as a string (e.g. '42', '3.14159'). Encoded as string because atproto does not support floating-point numbers and cannot distinguish integer from float at the type level.

**Constraints**: maxLength: 128

### `org.designtxt.defs#shadowValue`

**Type**: `object`

A composite shadow value (drop shadow / box-shadow) with color, offsets, blur, spread.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `blur` | `ref` → `#dimensionValue` | No | Blur radius. |
| `color` | `ref` → `#colorValue` | No | Shadow color. |
| `inset` | `boolean` | No | Whether the shadow is inset (inner shadow). |
| `spread` | `ref` → `#dimensionValue` | No | Spread radius. |
| `offsetX` | `ref` → `#dimensionValue` | No | Horizontal offset. |
| `offsetY` | `ref` → `#dimensionValue` | No | Vertical offset. |

### `org.designtxt.defs#durationValue`

**Type**: `object`

A duration with a numeric value and time unit. The value is a string-encoded float because atproto does not support floating-point numbers.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `unit` | `string` | Yes | The time unit. |
| `value` | `string` | Yes | The numeric magnitude as a string-encoded float (e.g. '150', '300.5'). |

### `org.designtxt.defs#gradientValue`

**Type**: `object`

A composite gradient value with type and color stops.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | `string` | No | Gradient type. |
| `angles` | `array` | No | Angle values in degrees as string-encoded floats. |
| `colorStops` | `array` | No | Color stops defining the gradient. |

### `org.designtxt.defs#dimensionValue`

**Type**: `object`

A dimension with a numeric value and CSS-compatible unit. The value is a string-encoded float because atproto does not support floating-point numbers.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `unit` | `string` | Yes | The unit of measurement. |
| `value` | `string` | Yes | The numeric magnitude as a string-encoded float (e.g. '16.5', '100', '0.25'). |

### `org.designtxt.defs#fontFamilyValue`

**Type**: `string`

A font family name or comma-separated fallback string.

**Constraints**: maxLength: 512

### `org.designtxt.defs#transitionValue`

**Type**: `object`

A composite transition value with duration, delay, and timing function.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `delay` | `ref` → `#durationValue` | No | Transition delay. |
| `duration` | `ref` → `#durationValue` | No | Transition duration. |
| `timingFunction` | `ref` → `#cubicBezierValue` | No | Timing function as a cubic Bezier curve. |

### `org.designtxt.defs#typographyValue`

**Type**: `object`

A composite typography value aggregating font family, weight, size, line metrics, and text transforms. Numeric values are string-encoded floats to accommodate the atproto data model.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `fontSize` | `ref` → `#dimensionValue` | No | Font size. |
| `textCase` | `string` | No | Text case transformation. |
| `fontFamily` | `array` | No | Ordered list of font family names (primary and fallbacks). |
| `fontWeight` | `union` | No | Font weight. |
| `lineHeight` | `string` | No | Line height as a string-encoded unitless multiplier (e.g. '1.5', '1.2'). |
| `letterSpacing` | `ref` → `#dimensionValue` | No | Letter spacing. |
| `textDecoration` | `string` | No | Text decoration. |
| `paragraphIndent` | `ref` → `#dimensionValue` | No | Paragraph indent. |
| `paragraphSpacing` | `ref` → `#dimensionValue` | No | Paragraph spacing. |

### `org.designtxt.defs#cubicBezierValue`

**Type**: `array`

A cubic Bezier curve defined by exactly 4 control-point string-encoded floats (x1, y1, x2, y2).

**Items**:

Type: `string`

**Constraints**: minItems: 4, maxItems: 4

### `org.designtxt.defs#fontWeightNumber`

**Type**: `integer`

```json
{
  "type": "integer",
  "maximum": 1000,
  "minimum": 1
}
```

### `org.designtxt.defs#strokeStyleValue`

**Type**: `object`

Stroke style properties (dash array, line cap/join, miter limit). Corresponds to DTCG 'strokeStyle' composite type. Dash lengths and miter limit are string-encoded floats.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `lineCap` | `string` | No | Shape at the end of open subpaths. |
| `lineJoin` | `string` | No | Shape at the corners of paths. |
| `dashArray` | `array` | No | Dash and gap lengths as string-encoded floats. |
| `miterLimit` | `string` | No | Maximum miter length when lineJoin is 'miter', as a string-encoded float. |

### `org.designtxt.defs#fontWeightKeyword`

**Type**: `string`

**Known Values**:
- `thin`
- `hairline`
- `extraLight`
- `ultraLight`
- `light`
- `normal`
- `regular`
- `book`
- `medium`
- `semiBold`
- `demiBold`
- `bold`
- `extraBold`
- `ultraBold`
- `black`
- `heavy`
- `extraBlack`
- `ultraBlack`

**Constraints**: maxLength: 16

## Raw Schema

```json
{
  "id": "org.designtxt.defs",
  "defs": {
    "colorStop": {
      "type": "object",
      "properties": {
        "color": {
          "ref": "#colorValue",
          "type": "ref",
          "description": "Color at this stop."
        },
        "position": {
          "type": "string",
          "maxLength": 64,
          "description": "Stop position as a string-encoded float (0-1 for proportional, or unitless percentage like '50')."
        }
      },
      "description": "A single gradient color stop. Position is a string-encoded float."
    },
    "colorValue": {
      "type": "object",
      "required": [
        "colorSpace",
        "components"
      ],
      "properties": {
        "hex": {
          "type": "string",
          "maxLength": 7,
          "description": "6-digit CSS hex fallback (e.g. #ff00ff).",
          "maxGraphemes": 7
        },
        "alpha": {
          "type": "string",
          "maxLength": 64,
          "description": "Opacity as a string-encoded float between '0' and '1'. Assumed '1' if omitted."
        },
        "colorSpace": {
          "type": "string",
          "maxLength": 16,
          "description": "The color space identifier.",
          "knownValues": [
            "srgb",
            "srgb-linear",
            "hsl",
            "hwb",
            "lab",
            "lch",
            "oklab",
            "oklch",
            "display-p3",
            "a98-rgb",
            "prophoto-rgb",
            "rec2020",
            "xyz-d65",
            "xyz-d50"
          ]
        },
        "components": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 64
          },
          "description": "Color component values (positional, depending on colorSpace). Each element is a string-encoded float (e.g. '0.4', '1.0') or the string 'none'."
        }
      },
      "description": "A color value expressed in a specific color space with optional alpha and hex fallback. Float components are stored as strings because the atproto data model does not support floating-point numbers."
    },
    "borderValue": {
      "type": "object",
      "properties": {
        "color": {
          "ref": "#colorValue",
          "type": "ref",
          "description": "Border color."
        },
        "style": {
          "type": "string",
          "maxLength": 8,
          "description": "Border line style.",
          "knownValues": [
            "solid",
            "dashed",
            "dotted",
            "double",
            "groove",
            "ridge",
            "inset",
            "outset",
            "none"
          ]
        },
        "width": {
          "ref": "#dimensionValue",
          "type": "ref",
          "description": "Border width."
        }
      },
      "description": "A composite border value combining width, line style, and color."
    },
    "numberValue": {
      "type": "string",
      "maxLength": 128,
      "description": "A numeric value encoded as a string (e.g. '42', '3.14159'). Encoded as string because atproto does not support floating-point numbers and cannot distinguish integer from float at the type level."
    },
    "shadowValue": {
      "type": "object",
      "properties": {
        "blur": {
          "ref": "#dimensionValue",
          "type": "ref",
          "description": "Blur radius."
        },
        "color": {
          "ref": "#colorValue",
          "type": "ref",
          "description": "Shadow color."
        },
        "inset": {
          "type": "boolean",
          "description": "Whether the shadow is inset (inner shadow)."
        },
        "spread": {
          "ref": "#dimensionValue",
          "type": "ref",
          "description": "Spread radius."
        },
        "offsetX": {
          "ref": "#dimensionValue",
          "type": "ref",
          "description": "Horizontal offset."
        },
        "offsetY": {
          "ref": "#dimensionValue",
          "type": "ref",
          "description": "Vertical offset."
        }
      },
      "description": "A composite shadow value (drop shadow / box-shadow) with color, offsets, blur, spread."
    },
    "durationValue": {
      "type": "object",
      "required": [
        "value",
        "unit"
      ],
      "properties": {
        "unit": {
          "type": "string",
          "maxLength": 4,
          "description": "The time unit.",
          "knownValues": [
            "ms",
            "s"
          ]
        },
        "value": {
          "type": "string",
          "maxLength": 64,
          "description": "The numeric magnitude as a string-encoded float (e.g. '150', '300.5')."
        }
      },
      "description": "A duration with a numeric value and time unit. The value is a string-encoded float because atproto does not support floating-point numbers."
    },
    "gradientValue": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "maxLength": 8,
          "description": "Gradient type.",
          "knownValues": [
            "linear",
            "radial",
            "conic"
          ]
        },
        "angles": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 64
          },
          "description": "Angle values in degrees as string-encoded floats."
        },
        "colorStops": {
          "type": "array",
          "items": {
            "ref": "#colorStop",
            "type": "ref"
          },
          "description": "Color stops defining the gradient."
        }
      },
      "description": "A composite gradient value with type and color stops."
    },
    "dimensionValue": {
      "type": "object",
      "required": [
        "value",
        "unit"
      ],
      "properties": {
        "unit": {
          "type": "string",
          "maxLength": 8,
          "description": "The unit of measurement.",
          "knownValues": [
            "px",
            "rem",
            "em",
            "pt",
            "pc",
            "in",
            "cm",
            "mm",
            "%",
            "vw",
            "vh",
            "vmin",
            "vmax",
            "ch",
            "ex"
          ]
        },
        "value": {
          "type": "string",
          "maxLength": 64,
          "description": "The numeric magnitude as a string-encoded float (e.g. '16.5', '100', '0.25')."
        }
      },
      "description": "A dimension with a numeric value and CSS-compatible unit. The value is a string-encoded float because atproto does not support floating-point numbers."
    },
    "fontFamilyValue": {
      "type": "string",
      "maxLength": 512,
      "description": "A font family name or comma-separated fallback string."
    },
    "transitionValue": {
      "type": "object",
      "properties": {
        "delay": {
          "ref": "#durationValue",
          "type": "ref",
          "description": "Transition delay."
        },
        "duration": {
          "ref": "#durationValue",
          "type": "ref",
          "description": "Transition duration."
        },
        "timingFunction": {
          "ref": "#cubicBezierValue",
          "type": "ref",
          "description": "Timing function as a cubic Bezier curve."
        }
      },
      "description": "A composite transition value with duration, delay, and timing function."
    },
    "typographyValue": {
      "type": "object",
      "properties": {
        "fontSize": {
          "ref": "#dimensionValue",
          "type": "ref",
          "description": "Font size."
        },
        "textCase": {
          "type": "string",
          "maxLength": 12,
          "description": "Text case transformation.",
          "knownValues": [
            "uppercase",
            "lowercase",
            "capitalize",
            "none"
          ]
        },
        "fontFamily": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 256
          },
          "description": "Ordered list of font family names (primary and fallbacks)."
        },
        "fontWeight": {
          "refs": [
            "#fontWeightKeyword",
            "#fontWeightNumber"
          ],
          "type": "union",
          "description": "Font weight."
        },
        "lineHeight": {
          "type": "string",
          "maxLength": 64,
          "description": "Line height as a string-encoded unitless multiplier (e.g. '1.5', '1.2')."
        },
        "letterSpacing": {
          "ref": "#dimensionValue",
          "type": "ref",
          "description": "Letter spacing."
        },
        "textDecoration": {
          "type": "string",
          "maxLength": 12,
          "description": "Text decoration.",
          "knownValues": [
            "underline",
            "overline",
            "line-through",
            "none"
          ]
        },
        "paragraphIndent": {
          "ref": "#dimensionValue",
          "type": "ref",
          "description": "Paragraph indent."
        },
        "paragraphSpacing": {
          "ref": "#dimensionValue",
          "type": "ref",
          "description": "Paragraph spacing."
        }
      },
      "description": "A composite typography value aggregating font family, weight, size, line metrics, and text transforms. Numeric values are string-encoded floats to accommodate the atproto data model."
    },
    "cubicBezierValue": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 64
      },
      "maxItems": 4,
      "minItems": 4,
      "description": "A cubic Bezier curve defined by exactly 4 control-point string-encoded floats (x1, y1, x2, y2)."
    },
    "fontWeightNumber": {
      "type": "integer",
      "maximum": 1000,
      "minimum": 1
    },
    "strokeStyleValue": {
      "type": "object",
      "properties": {
        "lineCap": {
          "type": "string",
          "maxLength": 8,
          "description": "Shape at the end of open subpaths.",
          "knownValues": [
            "round",
            "butt",
            "square"
          ]
        },
        "lineJoin": {
          "type": "string",
          "maxLength": 8,
          "description": "Shape at the corners of paths.",
          "knownValues": [
            "miter",
            "bevel",
            "round"
          ]
        },
        "dashArray": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 64
          },
          "description": "Dash and gap lengths as string-encoded floats."
        },
        "miterLimit": {
          "type": "string",
          "maxLength": 64,
          "description": "Maximum miter length when lineJoin is 'miter', as a string-encoded float."
        }
      },
      "description": "Stroke style properties (dash array, line cap/join, miter limit). Corresponds to DTCG 'strokeStyle' composite type. Dash lengths and miter limit are string-encoded floats."
    },
    "fontWeightKeyword": {
      "type": "string",
      "maxLength": 16,
      "knownValues": [
        "thin",
        "hairline",
        "extraLight",
        "ultraLight",
        "light",
        "normal",
        "regular",
        "book",
        "medium",
        "semiBold",
        "demiBold",
        "bold",
        "extraBold",
        "ultraBold",
        "black",
        "heavy",
        "extraBlack",
        "ultraBlack"
      ]
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "Shared type definitions for Design Tokens, based on DTCG 2025.10 stable specification. Defines scalar value types (color, dimension, duration, etc.) and composite value types (border, shadow, typography, etc.) used by token and resolver records."
}
```
