Skip to content

design-token/line-height

Summary

Enforces line-height values to match the line-height tokens defined in your configuration.

Configuration

Enable the rule in designlint.config.*. See configuration for defining tokens.

json
{
  "tokens": {
    "$version": "1.0.0",
    "lineHeights": {
      "base": { "$type": "number", "$value": 1.5 },
      "tight": { "$type": "number", "$ref": "#/lineHeights/base" }
    }
  },
  "rules": { "design-token/line-height": "error" }
}

Line-height tokens use the number type.

Options

No additional options.

This rule is not auto-fixable.

Examples

Invalid

css
.text { line-height: 2; }

Valid

css
.text { line-height: 1.5; }
.text { line-height: 20px; }

When Not To Use

If line heights are not standardized, disable this rule.

See also

Released under the MIT License.