You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -26,172 +26,146 @@ See the `@spectrum-web-components/theme` [documentation](../theme) for more info
26
26
yarn add @spectrum-web-components/styles
27
27
```
28
28
29
-
### System variants
29
+
### Design tokens
30
30
31
-
This package provides styles for three Adobe design system variants (referred to as "systems"). Each system has different available color options:
31
+
This package provides design token CSS custom properties for three Adobe design system variants (referred to as "systems").
32
32
33
-
-**Spectrum** (system: `spectrum`) - The original Spectrum design system with four color options: `dark`, `light`, and deprecated `darkest` and `lightest`
34
-
-**Express** (system: `express`) - The Adobe Express design system with two color options: `dark` and `light`
35
-
-**Spectrum 2** (system: `spectrum-two`) - The next generation Spectrum design system with two color options: `dark` and `light`
33
+
**Color options:** Each system has different available color options, but in the future, each will have only `dark` and `light` available.
36
34
37
-
### Combined theme packages (Spectrum)
35
+
**Scales:** Each system has two scale sizes available: `medium` (default) and `large`. The `medium` scale is designed for desktop environments with slightly smaller components and spacing, while the `large` scale is optimized for mobile and touch devices with larger touch targets and spacing.
38
36
39
-
If you're not using `<sp-theme>`, the styles package provides convenient bundles for Spectrum that combine everything you need in a single import. Each `all-*` file combines core global styles, typography, a color option, and a scale specification. Express and Spectrum 2 do not have equivalent combined packages; use manual theme composition instead (see below).
37
+
**Available systems:**
40
38
41
-
> **Note:** The `darkest` and `lightest` colors are deprecated and will be removed in a future release. Use `dark` or `light` instead.
39
+
-**Spectrum** (system: `spectrum`) - The original Spectrum design system
40
+
-**Colors:**`dark`, `light`, and deprecated `darkest` and `lightest`
41
+
-**Scales:**`medium`, `large`
42
+
-**Express** (system: `express`) - The Adobe Express design system
43
+
-**Colors:**`dark`, `light`
44
+
-**Scales:**`medium`, `large`
45
+
-**Spectrum 2** (system: `spectrum-two`) - The next generation Spectrum design system
This file brings together the global variables and font settings with the "Light" color set and "Medium" scale system specification.
54
-
55
-
Other available combinations: `all-large-dark.css`, `all-large-light.css`, and the deprecated `all-medium-darkest.css`, `all-medium-lightest.css`, `all-large-darkest.css`, `all-large-lightest.css`.
56
-
57
-
### Manual theme composition (Express and Spectrum 2)
58
-
59
-
If you're not using `<sp-theme>`, you can manually compose a complete theme for Express or Spectrum 2 (equivalent to the `all-*` convenience packages for Spectrum) by importing four files: core global styles, typography, a color option, and a scale.
62
+
#### Spectrum tokens
60
63
61
-
#### Express example (large, dark)
64
+
Spectrum uses a base + override pattern. Import base tokens first, then system-specific overrides:
Express also uses a base + override pattern (same as Spectrum above, but with `express/` paths):
78
81
79
-
> **Note:** For most use cases, we recommend using `<sp-theme>` instead of manually managing these imports. The theme element handles composition and switching automatically.
For more control over bundle size or to manually compose themes, you can import color and scale files individually. These provide only the CSS custom properties specific to color or scale, without the combined overhead of the `all-*` packages.
94
+
#### Tokens usage
84
95
85
-
#### Color
96
+
Which tokens files you import will depend on which tokens you want to use.
Generally speaking, `light-vars` and `dark-vars` files contain raw color custom property definitions (such as `--spectrum-red-500`), as well as semantic custom property definitions that change depending on which color option you use. For instance, in the v2-tokens, `--spectrum-neutral-subdued-background-color-default` uses different values per theme. It resolves to `--spectrum-gray-700` for light and `--spectrum-gray-500` for dark.
For color, `global-vars` files contain semantic custom property definitions that stay consistent regardless of color option. For instance, `--spectrum-neutral-background-color-default` is always `--spectrum-gray-800`, but `--spectrum-gray-800` is defined differently depending on whether dark or light custom properties have been imported. Component-specific custom properties are split across these files. Some are in `global-vars` (e.g., `--spectrum-swatch-border-color`), while others are in `light-vars`/`dark-vars` (e.g., `--spectrum-assetcard-border-color-selected`).
Similarly, `medium-vars` and `large-vars` files contain custom property definitions for raw spacings and sizes that differ between the two scales, such as `--spectrum-font-size-200` and `--spectrum-component-height-100`. They also contain component-specific custom property definitions that differ between scales, for instance `--spectrum-meter-width`. The `global-vars` file defines custom properties related to sizing or spacing that are consistent regardless of scale (e.g., `--spectrum-corner-radius-100`), or uses custom properties defined in `medium-vars`/`large-vars` (e.g., `--spectrum-meter-default-width: var(--spectrum-meter-width);`).
> **Note:** All color theme files automatically set the CSS `color-scheme` property (`light` or `dark`) for accessibility. This helps browsers render native form controls appropriately, adjusts scrollbar colors to match the theme, and improves compatibility with system UI elements.
124
-
125
-
#### Scale
126
-
127
-
Import a single scale to set sizing values:
106
+
Here's one example of tokens usage in a non-web-component context, showing how custom properties from each file work together:
Each individual export (`body.js`, `heading.js`, etc.) includes the necessary base and language support styles, so you don't need to import them separately. Import `typography.js` for the complete system, or import individual exports to reduce bundle size.
254
228
229
+
### Spectrum Vars tokens (deprecated)
230
+
231
+
This package includes some deprecated files that use the older Spectrum Vars token naming convention, including combined theme files (e.g., `all-medium-dark.css`) and individual theme/scale files (e.g., `theme-light.css`, `scale-medium.css`).
232
+
233
+
**Recommended alternatives:**
234
+
235
+
- Use `<sp-theme>` for automatic theme management (recommended)
236
+
- Import Spectrum Core tokens directly for granular control (see "Design tokens" section above)
237
+
- See the [Spectrum Core tokens migration guide](../theme/core-tokens.md) for help migrating from Spectrum Vars to Spectrum Core tokens
238
+
255
239
### Migrating to Spectrum 2
256
240
257
241
If you're migrating to Spectrum 2, see the [Spectrum 2 migration guide](../../migrating-to-spectrum2/) for detailed instructions.
0 commit comments