bg-ods-primary, text-ods-primary, border-ods-primary |
bg-ods-surface-brand, text-ods-content-brand, border-ods-border-brand |
bg-ods-success, text-ods-success, border-ods-success |
bg-ods-surface-success, text-ods-content-success, border-ods-border-success |
bg-ods-critical, text-ods-critical, border-ods-critical |
bg-ods-surface-critical, text-ods-content-critical, border-ods-border-critical |
rounded-ods-xs (2px) |
no 2px radius in v20: rounded-ods-control (4px), or rounded-xs |
rounded-ods-sm (4px) |
rounded-ods-control |
rounded-ods-md (8px) |
rounded-ods-container |
rounded-ods-lg (16px) |
rounded-ods-pill |
font-ods-default |
font-ods-body, or nothing: it is the page font |
As for the tokens, a color depends on the property: a `bg-` reads a surface, a `text-` a content color, a `border-` a border color. `bg-ods-brand` is the logo color, not a surface.
To find the classes:
```sh
grep -rnE -- '[a-z-]+-ods-(primary|success|warning|critical|xs|sm|md|lg|default)\b|ods-(color-[a-z]+-[0-9]+|border-radius-[a-z]+|font-family-default)' src/
```
## Custom themes
A v19 custom theme, including any Theme Generator export, declares `--ods-theme-*` and `--ods-color-*`. v20 neither declares nor reads these names, so such a theme has **no effect**, without any warning.
To find them in your code:
```sh
grep -rnE -- "--ods-(theme|color)-[a-z0-9-]+[\"']?[[:space:]]*:" src/
```
In v20, a theme re-declares the brand and accent ramps (`--ods-palette-brand-*` and `--ods-palette-accent-*`, from 50 to 900) on `:root`, in a stylesheet loaded after the theme it builds on.
**before**
```css
:root {
--ods-color-primary-500: #7a00cc;
--ods-theme-primary-color: var(--ods-color-primary-500);
}
```
**after**
```css
:root {
--ods-palette-brand-500: #7a00cc;
/* and the other brand and accent rungs, from 50 to 900 */
}
```
The ramps do not reach every role. The focus ring (`--ods-semantic-color-focus`), the status families and the chart series keep their default values, on purpose. Over the default theme alone, the brand ghost and outline Buttons take their text from the accent ramp (`--ods-semantic-color-content-brand-minor` and `--ods-semantic-color-content-on-brand`, on accent `800`) and their border from gray (`--ods-semantic-color-border-brand-minor`): the brand ramp reaches neither, and the border follows no ramp. Re-declare these `--ods-semantic-*` roles to change them. `@ovhcloud/ods-themes/blue-jeans/css` points the three at the brand ramp instead (`500`, `700` and `500`), so a theme loaded after it repaints them through that ramp. The ramps also only take effect on `:root`: a theme scoped to a container, such as the root of a micro-frontend, re-declares the `--ods-semantic-*` roles themselves.
Load a single theme, then your stylesheet after it: a theme loaded after your stylesheet overrides every token it declares, palette ramps included.
## Design tokens JSON
`@ovhcloud/ods-themes/default/tokens` keeps its shape, but every key changes: it lists the `--ods-semantic-*` and `--ods-palette-*` tokens. `root` gives the value each token resolves to, and `refs` the `var()` reference of the tokens that point at another one.
To find the imports in your code:
```sh
grep -rn "ods-themes/default/tokens" src/
```
**before**
```ts
import tokens from '@ovhcloud/ods-themes/default/tokens';
const brand = tokens.root['--ods-theme-primary-color'];
```
**after**
```ts
import tokens from '@ovhcloud/ods-themes/default/tokens';
const brand = tokens.root['--ods-semantic-color-surface-brand'];
```
Each theme ships its own JSON: `@ovhcloud/ods-themes/blue-jeans/tokens`, `aluminium-dark/tokens` and `blue-jeans-dark/tokens`. They share the `--ods-semantic-*` keys; the `--ods-palette-*` keys belong to each theme. If you move to Blue Jeans to keep the OVHcloud look, read `blue-jeans/tokens`: `default/tokens` gives the Aluminium values.
## Theme names in JavaScript
The JavaScript entry point of `@ovhcloud/ods-themes` is removed, with the `ODS_THEME` enum and the `ODS_THEMES` list it exported. They only ever held `default`. Importing them now fails at build time.
To find them in your code:
```sh
grep -rnE "ODS_THEMES?\b" src/
```
**before**
```ts
import { ODS_THEME, ODS_THEMES } from '@ovhcloud/ods-themes';
const theme = ODS_THEME.default;
const themes = ODS_THEMES;
```
**after**
```ts
const theme = 'default';
const themes = ['default', 'aluminium-dark', 'blue-jeans', 'blue-jeans-dark'] as const;
```
Keep the list of themes in your application: list the ones it offers, each loaded through its export path, `@ovhcloud/ods-themes/