# Type

Source: https://material.spynejs.com/foundations/type
Part of: Material shell gallery, Google's Material Design 3 for SpyneJS. Index: https://material.spynejs.com/llms.txt

Material's type scale: fifteen styles (display, headline, title, body and label, each large, medium and small), each plain and emphasized. The template gives every heading and every kind of text its style; a model does not choose type.

## In an app model

Nothing. A model writes words; the template gives each kind of text its style. A heading takes the emphasized set and running text the plain one, as the table below shows.

## The custom properties

A style is five custom properties, named `--md-sys-typescale-`, the style, and one of `font`, `size`, `line-height`, `weight`, `tracking`. The emphasized set has `emphasized-` before the style. Text of your own takes a style by setting all five:

```css
.my-caption {
  font-family: var(--md-sys-typescale-body-small-font);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
  font-weight: var(--md-sys-typescale-body-small-weight);
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
}
```

- Use the heading elements (`h1` to `h6`) and `p` as they are: each already has its style.
- The typeface is Roboto, served by the app itself. No font is loaded from another site.

## Where it is in the template

| File | What it holds | By name |
| --- | --- | --- |
| `src/scss/03-components/material/_type.scss` | which style each heading and each kind of text takes |  |
| `src/scss/00-spynejs-design-system/tokens/_material.scss` | the styles themselves, read from Google’s tokens |  |
| `src/scss/00-spynejs-design-system/tokens/_material-typeface.scss` | Roboto, in the weights Material uses |  |

The template is public: https://github.com/spynejs/application-shell-material. An app made from it has these same files.

## As the page shows it

The page’s own words, in its own order, read from the page as it is drawn in the light colour scheme. They were written for someone looking at the page: “above”, “below” and “marked” mean the drawn page. A thing the page draws is named here in its place (`Button:`, `Field:`, `Switch:`), and a box that reports what the reader does is as it starts, empty. What depends on the reader’s own window is left out.

Material’s type scale: five kinds of text in three sizes. Each style is shown twice, plain and then emphasized, the heavier variant that the Expressive revision adds. Under each line are its size, line height, weight and letter spacing, read from the line itself.

### Display

| Style | Used for | Plain | Emphasized |
| --- | --- | --- | --- |
| display-large |  | 57px / 64px · weight 400 · spacing -0.25px | 57px / 64px · weight 500 · spacing -0.25px |
| display-medium | Emphasized: the hero’s headline. | 45px / 52px · weight 400 · spacing normal | 45px / 52px · weight 500 · spacing normal |
| display-small | Emphasized: a page’s first heading (h1). | 36px / 44px · weight 400 · spacing normal | 36px / 44px · weight 500 · spacing normal |

### Headline

| Style | Used for | Plain | Emphasized |
| --- | --- | --- | --- |
| headline-large | The extra large button’s label. | 32px / 40px · weight 400 · spacing normal | 32px / 40px · weight 500 · spacing normal |
| headline-medium | Emphasized: h2. | 28px / 36px · weight 400 · spacing normal | 28px / 36px · weight 500 · spacing normal |
| headline-small | Emphasized: h3. The large button’s label. | 24px / 32px · weight 400 · spacing normal | 24px / 32px · weight 500 · spacing normal |

### Title

| Style | Used for | Plain | Emphasized |
| --- | --- | --- | --- |
| title-large | Emphasized: h4, and a card’s title. Plain: the app bar’s title. | 22px / 28px · weight 400 · spacing normal | 22px / 28px · weight 500 · spacing normal |
| title-medium | Plain: h5. The medium button’s label. | 16px / 24px · weight 500 · spacing 0.15px | 16px / 24px · weight 700 · spacing 0.15px |
| title-small | Plain: h6. | 14px / 20px · weight 500 · spacing 0.1px | 14px / 20px · weight 700 · spacing 0.1px |

### Body

| Style | Used for | Plain | Emphasized |
| --- | --- | --- | --- |
| body-large | Plain: running text. | 16px / 24px · weight 400 · spacing 0.5px | 16px / 24px · weight 500 · spacing 0.5px |
| body-medium | Plain: small text, and a card’s supporting text. | 14px / 20px · weight 400 · spacing 0.25px | 14px / 20px · weight 500 · spacing 0.25px |
| body-small | A text field’s label, once it has risen. | 12px / 16px · weight 400 · spacing 0.4px | 12px / 16px · weight 500 · spacing 0.4px |

### Label

| Style | Used for | Plain | Emphasized |
| --- | --- | --- | --- |
| label-large | The small and extra small buttons’ labels. | 14px / 20px · weight 500 · spacing 0.1px | 14px / 20px · weight 700 · spacing 0.1px |
| label-medium |  | 12px / 16px · weight 500 · spacing 0.5px | 12px / 16px · weight 700 · spacing 0.5px |
| label-small |  | 11px / 16px · weight 500 · spacing 0.5px | 11px / 16px · weight 700 · spacing 0.5px |
