Skip to content

Typography

Typography tokens in the Jux Editor

Jux supports typography tokens as a composite token that binds together the following properties:

  1. Font family
  2. Font size
  3. Font weight
  4. Line height
  5. Letter spacing
Typography Token

Each of the fields can be tokenized by itself (by pointing to another token of a relevant type)

  1. Font family - unique font family token
  2. Font size - dimension token
  3. Font weight - unique font weight token soon
  4. Line height - dimension token
  5. Letter spacing - dimension token

Typography tokens have these fields:

  1. A name (like blue-500 or primary-bg)
  2. A folder path (like color/core/blue-500)
  3. Optional - an alias to another token
  4. Font family
  5. Font size
  6. Font weight
  7. Optional - Line height
  8. Optional - Letter spacing
  9. Optional - description
Typography Props

Typography tokens can only be used in the text module.

Each typography field can be tokenized by clicking on the ‘token icon button’ that appears on the right side of the field upon hover. When the typography field is tokenized - the 5 subfields are disabled. In order to enable them - the typography token must be detached.

DDP Typography Field

Under the hood

JUX adheres to the W3C Community group’s draft guidelines regarding typography tokens (section 9.7.) and stores the token as a JSON file with the following structure:

{
// Our opinianated structure uses type-based groups at the root level
"dimension": {
// We like to use core/semantic/specific as the base groups in all token
// types, but this group's name can be any valid JSON identifier
"core": {
// Token names must be valid JSON identifiers, e.g. "Foo", "foo_0", "spacing_xs"
"spacing_xs": {
// Specifying the type here might seem redundant since the type is used
// as the root-level grouping, but this is part of the W3C group's specs
"$type": "dimension",
"$value": "4px"
"$description": "Use only for padding and gaps"
}
}
}
}