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
Copy file name to clipboardExpand all lines: 1st-gen/tools/styles/README.md
+61-48Lines changed: 61 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,39 +26,39 @@ 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
+
###System variants
30
30
31
31
This package provides styles for three Adobe design system variants (referred to as "systems"). Each system has different available color options:
32
32
33
-
-**Spectrum Legacy** (system: `spectrum`) - The original Spectrum design system with four color options: `dark`, `light`, and deprecated `darkest` and `lightest`
33
+
-**Spectrum** (system: `spectrum`) - The original Spectrum design system with four color options: `dark`, `light`, and deprecated `darkest` and `lightest`
34
34
-**Express** (system: `express`) - The Adobe Express design system with two color options: `dark` and `light`
35
35
-**Spectrum 2** (system: `spectrum-two`) - The next generation Spectrum design system with two color options: `dark` and `light`
36
36
37
-
## Combined theme packages (Spectrum Legacy)
37
+
###Combined theme packages (Spectrum)
38
38
39
-
If you're not using `<sp-theme>`, the styles package provides convenience bundles for Spectrum Legacy 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).
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).
40
40
41
41
> **Note:** The `darkest` and `lightest` colors are deprecated and will be removed in a future release. Use `dark` or `light` instead.
This file brings together the global variables and font settings with the "Light" color set and "Medium" scale system specification.
54
54
55
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
56
57
-
## Manual theme composition (Express and Spectrum 2)
57
+
###Manual theme composition (Express and Spectrum 2)
58
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 Legacy) by importing four files: core global styles, typography, a color option, and a scale.
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.
@@ -78,16 +78,16 @@ If you're not using `<sp-theme>`, you can manually compose a complete theme for
78
78
79
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.
80
80
81
-
## Individual theme and scale files
81
+
###Individual theme and scale files
82
82
83
83
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.
@@ -122,12 +122,12 @@ Import a single color option to set color values:
122
122
123
123
> **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.
This file provides the complete [Spectrum Typography system](https://opensource.adobe.com/spectrum-css/?path=/docs/components-typography--docs). The typography system is shared across all design systems (Spectrum Legacy, Express, and Spectrum 2).
165
+
The [Spectrum Typography system](https://opensource.adobe.com/spectrum-css/?path=/docs/components-typography--docs) provides a complete set of text styles. The typography system is shared across all design systems (Spectrum, Express, and Spectrum 2).
170
166
171
-
**What's included:**
167
+
#### What's included
172
168
173
169
-**Heading** styles (`.spectrum-Heading`) - Multiple sizes from XXS to XXXL with weight variants (light, regular, heavy) and serif options
174
170
-**Body** styles (`.spectrum-Body`) - Multiple sizes from XS to XXXL with serif options for body copy and longer text
@@ -178,63 +174,80 @@ This file provides the complete [Spectrum Typography system](https://opensource.
178
174
-**Emphasis and strong** - Proper italic and bold styling for `<em>` and `<strong>` elements within each typography class
179
175
-**High contrast mode support** - Ensures text remains readable when Windows High Contrast Mode is enabled
180
176
181
-
### TypeScript/JavaScript exports for Lit components
177
+
#### CSS imports
178
+
179
+
For stylesheet use, import the complete typography system:
#### TypeScript/JavaScript exports for Lit components
186
+
187
+
For use in Lit-based components, you can import typography styles as JavaScript modules. Import the complete system or individual components depending on your needs:
182
188
183
-
For use in Lit-based components, you can import typography styles as JavaScript modules:
Import individual exports when you only need specific typography components to reduce bundle size.
207
+
##### Available JavaScript exports
203
208
204
-
## Design tokens
209
+
-**`typography.js`** - Complete typography system with all styles (heading, body, detail, code)
210
+
-**`body.js`** - Body text styles only (includes base + lang + body)
211
+
-**`heading.js`** - Heading styles only (includes base + lang + heading)
212
+
-**`detail.js`** - Detail/label styles only (includes base + lang + detail)
213
+
-**`code.js`** - Code styles only (includes base + lang + code)
214
+
215
+
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.
216
+
217
+
### Design tokens
205
218
206
219
For advanced use cases where you need direct access to design token CSS custom properties, this package exposes token files:
0 commit comments