Skip to content

Commit f1bfc56

Browse files
authored
docs: mark old token systems as deprecated and transitional (#5191)
* docs: mark old token systems as deprecated and transitional * docs: replace legacy tokens example with CSS variables in getting started guide
1 parent c74ecd6 commit f1bfc56

5 files changed

Lines changed: 50 additions & 13 deletions

File tree

apps/design-system-docs/docs/about/getting-started/develop/getting_started_development.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,21 @@ For consistent styling, install and use design tokens:
5858
npm install @equinor/eds-tokens
5959
```
6060

61-
```javascript
62-
import { tokens } from '@equinor/eds-tokens'
61+
Import the CSS variables and use them in your styles:
6362

64-
const { typography, colors } = tokens
63+
```css
64+
@import '@equinor/eds-tokens/css/variables';
6565

66-
const styles = {
67-
fontSize: typography.heading.h1.fontSize,
68-
color: colors.interactive.primary__resting.rgba,
66+
.my-component {
67+
background-color: var(--eds-color-bg-neutral-surface);
68+
color: var(--eds-color-text-neutral-strong);
6969
}
7070
```
7171

72+
:::note
73+
The token structure is being replaced. The CSS variables are the supported option today, but the variable names will change in the next major release of `@equinor/eds-tokens`, so keep direct variable references few and centralised. The older `tokens` JavaScript object is deprecated and should not be used in new code. See the [package README](https://www.npmjs.com/package/@equinor/eds-tokens) for details.
74+
:::
75+
7276
## Key Features
7377

7478
**TypeScript support:** Full autocomplete, type checking, and inline documentation included.

packages/eds-tokens/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
* update tokens from Tokens Studio release ([#5182](https://github.com/equinor/design-system/issues/5182)) ([6074f72](https://github.com/equinor/design-system/commit/6074f721b4072741c50498d63c10ab3ebe45185e))
1414

15+
## [2.3.2](https://github.com/equinor/design-system/compare/eds-tokens@v2.3.1...eds-tokens@v2.3.2) (2026-07-20)
16+
17+
Documentation-only release — no token changes.
18+
19+
### 📝 Documentation
20+
21+
* mark the legacy `tokens` JavaScript object as deprecated (do not use in new code) and flag the CSS variables as transitional: still the supported option for production, but the variable names will be replaced by the new token structure (currently on `@equinor/eds-tokens@beta`) in the next major release ([#5120](https://github.com/equinor/design-system/issues/5120))
22+
1523
## [2.3.1](https://github.com/equinor/design-system/compare/eds-tokens@v2.3.0...eds-tokens@v2.3.1) (2026-06-23)
1624

1725

packages/eds-tokens/README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,32 @@ pnpm add @equinor/eds-tokens
1313

1414
## Usage
1515

16+
> **⚠️ Transition notice.** The token structure in this package is being
17+
> replaced. The replacement is developed on the beta line
18+
> (`@equinor/eds-tokens@beta`) and ships as the next major release.
19+
>
20+
> * **Need tokens today?** Use the CSS variables — they are the supported
21+
> option for production and keep working throughout 2.x. Expect the
22+
> variable names to change in the next major release; keeping direct
23+
> variable references few and centralised will make that migration cheap.
24+
> * **Do not** adopt the legacy `tokens` JavaScript object in new code — it
25+
> is deprecated and will be removed in the next major release.
26+
> * The beta line is for testing and feedback, not production use.
27+
1628
The package provides two token systems:
1729

18-
* **CSS Variables (Recommended)** -- Modern, theme-aware design tokens synced from Figma
19-
* **Legacy Tokens** -- Original token format, still supported for backward compatibility
30+
* **CSS Variables** -- Theme-aware design tokens synced from Figma. Supported for production; the variable names will change in the next major release.
31+
* **Legacy Tokens** -- Original token format. Deprecated: do not use in new code.
2032

2133
---
2234

23-
## CSS Variables (Recommended)
35+
## CSS Variables
36+
37+
> These `--eds-*` variables will be replaced by the new token structure in
38+
> the next major release. They remain the supported way to consume EDS
39+
> tokens today (`@equinor/eds-core-react` 2.x requires `css/variables`) —
40+
> just keep direct variable references organised so the rename in the next
41+
> major is easy to absorb.
2442
2543
The new token system uses CSS custom properties that automatically adapt to light and dark color schemes via explicit `[data-color-scheme]` scope rules with a `prefers-color-scheme` media-query fallback. These tokens are directly synced from Figma variables.
2644

@@ -309,9 +327,9 @@ These utilities use modern CSS features (`text-box-trim`) and gracefully degrade
309327

310328
---
311329

312-
## Legacy Tokens (Backward Compatible)
330+
## Legacy Tokens (deprecated — do not use)
313331

314-
The original token format is still available for existing applications. These tokens use a structured JavaScript object format.
332+
**Deprecated.** The original token format remains published only so existing applications keep working, and will be removed in the next major release. These tokens use a structured JavaScript object format.
315333

316334
### Using Legacy Tokens in JavaScript/TypeScript
317335

@@ -334,7 +352,7 @@ const typography = tokens.typography.heading.h1
334352
* Interaction states
335353
* Typography (`ot`, `woff` or `woff2` font required)
336354

337-
> We recommend migrating to CSS Variables for new projects to benefit from automatic theme support and better performance.
355+
> Do not adopt these legacy tokens in new projects. If you need tokens today, use the CSS variables above; the long-term replacement is the new token structure currently on the beta line (`@equinor/eds-tokens@beta`).
338356
339357
[design tokens]: https://css-tricks.com/what-are-design-tokens/
340358

packages/eds-tokens/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@equinor/eds-tokens",
3-
"version": "2.3.1",
3+
"version": "2.3.2",
44
"description": "Design tokens for the Equinor Design System",
55
"type": "module",
66
"exports": {

packages/eds-tokens/src/base/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ import { shape } from './shape'
66
import { typography } from './typography'
77
import { spacings } from './spacings'
88

9+
/**
10+
* @deprecated Do not use in new code — this legacy token object will be
11+
* removed in the next major release. If you need tokens today, use the CSS
12+
* variables (`@equinor/eds-tokens/css/variables`); the long-term
13+
* replacement is the new token structure on the beta line
14+
* (`@equinor/eds-tokens@beta`).
15+
*/
916
export const tokens = {
1017
clickbounds,
1118
colors,

0 commit comments

Comments
 (0)