Skip to content

Font scale tokens ​

This example highlights fontScale flags on dimension tokens to show which values respond to user text sizing. It pairs fixed dp spacing with scalable sp values.

See font-scale.tokens.json for the complete document.

Sample tokens ​

json
{
  "$version": "1.0.0",
  "spacing": {
    "fixed": {
      "$type": "dimension",
      "$value": {
        "dimensionType": "length",
        "value": 16,
        "unit": "dp",
        "fontScale": false
      }
    },
    "scaled": {
      "$type": "dimension",
      "$value": {
        "dimensionType": "length",
        "value": 16,
        "unit": "sp",
        "fontScale": true
      }
    }
  }
}