
# Migration to 1.0.0 tokens

> This guide will help you understand how to transition an existing project from using the release candidates of Kesko Design System’s design tokens to using the stable 1.0.0 version.

## What’s changing?

Before locking the names down, three parts of the design token structure were renamed: the `highlight` color group becomes `-hover` tokens next to each theme and status color, the text colors meant for hover states drop their `-dim` suffix, and the icon size scale now starts at `md` for 16 px.

---

## Updating dependencies

To migrate your application to use the stable Kesko Design System tokens, update package.json with the necessary dependencies:

- Update existing `@kesko/tokens`, `@kesko/css` and `@kesko/themes` to version `1.0.0`.
- If you use `@kesko/components`, update it to `1.0.0-rc.4` or newer so its bundled CSS uses the renamed tokens and icon sizes.
- If you use the React icons, update existing `@kesko/iconography` to version `3.0.0` and follow the [icons 3.0.0 migration guide](/migration/migration-to-3.0.0-icons/).

Here’s an example `package.json`:

```json
{
  "dependencies": {
    "@kesko/tokens": "^1.0.0",
    "@kesko/css": "^1.0.0",
    "@kesko/themes": "^1.0.0"
  }
}
```

Nothing else in your integration needs to change. If you load the stylesheets from the [CDN](/cdn/), point the `<link>` tags at the `1.0.0` files and update their integrity hashes.

---

## Breaking changes

We’ve renamed the following tokens so that every hover shade lives next to the color it belongs to. If you’re using any of these tokens, you should search and replace their names so that they continue working after the update:

| 1.0.0-rc                        | 1.0.0                             |
| ------------------------------- | --------------------------------- |
| `--k-color-highlight-primary`   | `--k-color-theme-primary-hover`   |
| `--k-color-highlight-secondary` | `--k-color-theme-secondary-hover` |
| `--k-color-highlight-inverted`  | `--k-color-theme-inverted-hover`  |
| `--k-color-highlight-info`      | `--k-color-status-info-hover`     |
| `--k-color-highlight-success`   | `--k-color-status-success-hover`  |
| `--k-color-highlight-warning`   | `--k-color-status-warning-hover`  |
| `--k-color-highlight-error`     | `--k-color-status-error-hover`    |
| `--k-color-text-link-dim`       | `--k-color-text-link-hover`       |
| `--k-color-text-inverted-dim`   | `--k-color-text-inverted-hover`   |
| `--k-color-text-info-dim`       | `--k-color-text-info-hover`       |
| `--k-color-text-success-dim`    | `--k-color-text-success-hover`    |
| `--k-color-text-warning-dim`    | `--k-color-text-warning-hover`    |
| `--k-color-text-error-dim`      | `--k-color-text-error-hover`      |

The same rename applies in every output format, for example `$k-color-highlight-primary` in SCSS, `KColorHighlightPrimary` in JavaScript and Swift, and `k_color_highlight_primary` in Android.

### Icon sizes

The icon size scale moves up two steps so that `md` is 16 px, like every other scale in the system. Every size keeps its pixel value:

| 1.0.0-rc           | 1.0.0               | Size  |
| ------------------ | ------------------- | ----- |
| `--k-size-icon-xs` | `--k-size-icon-md`  | 16 px |
| `--k-size-icon-sm` | `--k-size-icon-lg`  | 20 px |
| `--k-size-icon-md` | `--k-size-icon-xl`  | 24 px |
| `--k-size-icon-lg` | `--k-size-icon-2xl` | 32 px |
| `--k-size-icon-xl` | `--k-size-icon-3xl` | 48 px |

Replace from the largest step down, so that an already renamed `--k-size-icon-md` is not picked up again.

### Utility classes

The utility classes in `@kesko/css` are generated from the design tokens, so they are renamed with the token changes:

```diff
- <div class="k-bg-highlight-primary">
+ <div class="k-bg-theme-primary-hover">
- <a class="k-text-link-dim">
+ <a class="k-text-link-hover">
```

`.k-bg-highlight-info`, `-success`, `-warning` and `-error` become `.k-bg-status-*-hover`, and the bare `.k-bg-highlight` class is removed.

---

## Getting support

Have a question about migration to `1.0.0`? Please head over to the [Support page](/help/) for more guidelines and ways to contact us.
