# Typography

> Text style utilities that set font size, weight and line height together.

Dify UI ships its type scale as Tailwind CSS utilities. Each utility sets font size, font weight and line height together, and a few also set uppercase text. Use one utility per text element instead of combining `text-*`, `font-*` and `leading-*` classes.

Names follow `<role>-<size>-<weight>`. Color is separate: pair a type utility with a text color token such as `text-text-secondary`.

## System

System styles are for interface text: labels, menu items, buttons and metadata.

| Utility                         | Size | Weight | Line height | Transform |
| ------------------------------- | ---- | ------ | ----------- | --------- |
| `system-2xs-regular-uppercase`  | 10px | 400    | 12px        | uppercase |
| `system-2xs-regular`            | 10px | 400    | 12px        | —         |
| `system-2xs-medium`             | 10px | 500    | 12px        | —         |
| `system-2xs-medium-uppercase`   | 10px | 500    | 12px        | uppercase |
| `system-2xs-semibold-uppercase` | 10px | 600    | 12px        | uppercase |
| `system-xs-regular`             | 12px | 400    | 16px        | —         |
| `system-xs-regular-uppercase`   | 12px | 400    | 16px        | uppercase |
| `system-xs-medium`              | 12px | 500    | 16px        | —         |
| `system-xs-medium-uppercase`    | 12px | 500    | 16px        | uppercase |
| `system-xs-semibold`            | 12px | 600    | 16px        | —         |
| `system-xs-semibold-uppercase`  | 12px | 600    | 16px        | uppercase |
| `system-sm-regular`             | 13px | 400    | 16px        | —         |
| `system-sm-medium`              | 13px | 500    | 16px        | —         |
| `system-sm-medium-uppercase`    | 13px | 500    | 16px        | uppercase |
| `system-sm-semibold`            | 13px | 600    | 16px        | —         |
| `system-sm-semibold-uppercase`  | 13px | 600    | 16px        | uppercase |
| `system-md-regular`             | 14px | 400    | 20px        | —         |
| `system-md-medium`              | 14px | 500    | 20px        | —         |
| `system-md-semibold`            | 14px | 600    | 20px        | —         |
| `system-md-semibold-uppercase`  | 14px | 600    | 20px        | uppercase |
| `system-xl-medium`              | 16px | 500    | 24px        | —         |
| `system-xl-semibold`            | 16px | 600    | 24px        | —         |

## Body

Body styles are for running text and descriptions.

| Utility            | Size | Weight | Line height | Transform |
| ------------------ | ---- | ------ | ----------- | --------- |
| `body-xs-regular`  | 12px | 400    | 16px        | —         |
| `body-xs-medium`   | 12px | 500    | 16px        | —         |
| `body-sm-regular`  | 13px | 400    | 16px        | —         |
| `body-sm-medium`   | 13px | 500    | 16px        | —         |
| `body-md-regular`  | 14px | 400    | 20px        | —         |
| `body-md-medium`   | 14px | 500    | 20px        | —         |
| `body-lg-regular`  | 15px | 400    | 20px        | —         |
| `body-2xl-regular` | 18px | 400    | 1.5         | —         |

## Title

Title styles are for headings in panels, dialogs and pages.

| Utility               | Size | Weight | Line height | Transform |
| --------------------- | ---- | ------ | ----------- | --------- |
| `title-xs-semi-bold`  | 12px | 600    | 16px        | —         |
| `title-sm-semi-bold`  | 13px | 600    | 16px        | —         |
| `title-md-semi-bold`  | 14px | 600    | 20px        | —         |
| `title-lg-bold`       | 15px | 700    | 1.2         | —         |
| `title-xl-semi-bold`  | 16px | 600    | 1.2         | —         |
| `title-2xl-semi-bold` | 18px | 600    | 1.2         | —         |
| `title-3xl-semi-bold` | 20px | 600    | 1.2         | —         |
| `title-3xl-bold`      | 20px | 700    | 1.2         | —         |
| `title-4xl-semi-bold` | 24px | 600    | 1.2         | —         |
| `title-5xl-semi-bold` | 30px | 600    | 1.2         | —         |
| `title-5xl-bold`      | 30px | 700    | 1.2         | —         |

## Code

| Utility            | Size | Weight | Line height | Transform |
| ------------------ | ---- | ------ | ----------- | --------- |
| `code-xs-regular`  | 12px | 400    | 1.5         | —         |
| `code-sm-regular`  | 13px | 400    | 1.5         | —         |
| `code-sm-semibold` | 13px | 600    | 1.5         | —         |

## Keyboard

`system-kbd` sets the text inside a keyboard shortcut. See [Kbd](/components/kbd.md).

| Utility      | Size | Weight | Line height | Transform |
| ------------ | ---- | ------ | ----------- | --------- |
| `system-kbd` | 12px | 500    | 16px        | —         |

## Extra theme keys

Dify UI also adds these keys to the Tailwind CSS theme, so classes such as `text-2xs` work alongside the default scale.

| Theme key    | Value      |
| ------------ | ---------- |
| `--text-2xs` | `0.625rem` |

The `docs-*` text styles on this site belong to the documentation site, not to Dify UI.
