-
Notifications
You must be signed in to change notification settings - Fork 236
docs: update styles docs #5855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
docs: update styles docs #5855
Conversation
|
📚 Branch Preview🔍 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
75ff964 to
4f6c32e
Compare
Rajdeepc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start! If you can take a look at the heading hierarchy that would help!
What's included section is optional for me! But you can take others suggestions on this whether to keep it or not!
| **Use this styles package directly** when you need: | ||
|
|
||
| - Fine-grained control over which CSS files are loaded | ||
| - To integrate Spectrum styles into non-web component contexts | ||
| - To build custom components outside the `<sp-theme>` wrapper | ||
| - Direct access to unthemed design tokens for advanced use cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are good points. Would you also like to create small snippets to demonstrate the usage?
1st-gen/tools/styles/README.md
Outdated
| - **Spectrum Legacy** (system: `spectrum`) - The original Spectrum design system with four color options: `dark`, `light`, and deprecated `darkest` and `lightest` | ||
| - **Express** (system: `express`) - The Adobe Express design system with two color options: `dark` and `light` | ||
| - **Spectrum 2** (system: `spectrum-two`) - The next generation Spectrum design system with two color options: `dark` and `light` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **Spectrum Legacy** (system: `spectrum`) - The original Spectrum design system with four color options: `dark`, `light`, and deprecated `darkest` and `lightest` | |
| - **Express** (system: `express`) - The Adobe Express design system with two color options: `dark` and `light` | |
| - **Spectrum 2** (system: `spectrum-two`) - The next generation Spectrum design system with two color options: `dark` and `light` | |
| - **Spectrum** (system: `spectrum`) - The original Spectrum design system with four color options: `dark`, `light`, and deprecated `darkest` and `lightest` | |
| - **Express** (system: `express`) - The Adobe Express design system with two color options: `dark` and `light` | |
| - **Spectrum 2** (system: `spectrum-two`) - The next generation Spectrum design system with two color options: `dark` and `light` |
1st-gen/tools/styles/README.md
Outdated
| - **Spectrum 2** (system: `spectrum-two`) - The next generation Spectrum design system with two color options: `dark` and `light` | ||
|
|
||
| ``` | ||
| ## Combined theme packages (Spectrum Legacy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Combined theme packages (Spectrum Legacy) | |
| ## Combined theme packages (Spectrum) |
1st-gen/tools/styles/README.md
Outdated
| 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). | ||
|
|
||
| > **Note:** The `darkest` and `lightest` colors are deprecated and will be removed in a future release. Use `dark` or `light` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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). | |
| > **Note:** The `darkest` and `lightest` colors are deprecated and will be removed in a future release. Use `dark` or `light` instead. | |
| 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). | |
| > **Note:** The `darkest` and `lightest` colors are deprecated and will be removed in a future release. Use `dark` or `light` instead. |
1st-gen/tools/styles/README.md
Outdated
|
|
||
| > **Note:** The `darkest` and `lightest` colors are deprecated and will be removed in a future release. Use `dark` or `light` instead. | ||
| ```ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ```ts | |
| ```js |
1st-gen/tools/styles/README.md
Outdated
| ``` | ||
| @import '@spectrum-web-components/styles/all-large-lightest.css'; | ||
| ``` | ||
| ## Individual theme and scale files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Individual theme and scale files | |
| #### Individual theme and scale files |
1st-gen/tools/styles/README.md
Outdated
| </sp-table> | ||
|
|
||
| ### Lightest | ||
| ## Typography |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Typography | |
| ### Typography |
1st-gen/tools/styles/README.md
Outdated
|
|
||
| ``` | ||
| @import '@spectrum-web-components/styles/theme-lightest.css'; | ||
| ```ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ```ts | |
| ```js |
1st-gen/tools/styles/README.md
Outdated
| 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). | ||
|
|
||
| ## Scale | ||
| **What's included:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| **What's included:** | |
| **What's included** |
1st-gen/tools/styles/README.md
Outdated
| ## Typography | ||
| Import individual exports when you only need specific typography components to reduce bundle size. | ||
|
|
||
| ## Design tokens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Design tokens | |
| ### Design tokens |
4f6c32e to
305737d
Compare
|
@Rajdeepc I think I've addressed most of your feedback here, thanks! I removed a lot of the references to "Legacy" since it doesn't seem like that's terminology we're using. I made a lot of adjustments to heading levels, although I ended up getting down to I addressed the syntax highlighting suggestions too! I realized that a lot of these are Last thing: you left a comment about code snippets, I haven't addressed this yet but wanted to push up what I had today. |
305737d to
e7a1d35
Compare
e7a1d35 to
5d2b4e8
Compare
b50d061 to
4d0d3c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were lots of lint warnings about keys being in the wrong order, so I've reordered things, happy to roll that back if that's not what we want!
marissahuysentruyt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only found one link that didn't work, and otherwise this looks great! I left a few extra questions for you, but I don't think any of them are blockers.
Nice work!
- Indentation fixes - Core tokens link fix - Use "Spectrum 2 tokens" rather than "v2-tokens" or "tokens-v2" - Adjust imports and comments in example
1st-gen/tools/styles/package.json
Outdated
| }, | ||
| "scripts": { | ||
| "test": "echo \"Error: run tests from mono-repo root.\" && exit 1" | ||
| "./tokens/*": "./tokens/*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected object keys to be in ascending order. './tokens/*' should be before './tokens/spectrum/custom-vars.css'.
reviewdog suggestion error
GitHub comment range and suggestion line range must be same. L87-L87 v.s. L80-L87There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this recommendation might set off lint warnings... reverting it.
This reverts commit 6a63a69.
| #### CSS imports | ||
|
|
||
| For stylesheet use, the recommended approach is to import the complete typography system, with tokens. This ensures that all required files are included. | ||
|
|
||
| ```css | ||
| @import '@spectrum-web-components/styles/tokens-v2/dark-vars.css'; /* import color tokens */ | ||
| @import '@spectrum-web-components/styles/tokens-v2/large-vars.css'; /* import scale tokens */ | ||
| @import '@spectrum-web-components/styles/tokens-v2/global-vars.css'; /* import global tokens */ | ||
| @import '@spectrum-web-components/styles/typography.css'; | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did briefly have an example with sp-tabs showing that you could import the full typography system or just import individual files. However, there are a lot you'd need (spectrum-base, spectrum-lang, spectrum-typography, spectrum-heading) so I don't think I even want to make that recommendation for usage like I did for the js imports, and I've removed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes sense. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree with this direction, just because someone can, doesnt mean they should. we should only ever document supported patterns. reduce the number of ways something can be done makes it easier to maintain in the long run!
marissahuysentruyt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Description
Updates the
@spectrum-web-components/stylespackage documentation for clarity and completeness.Updated 11/11: Expands documentation to more thoroughly describe tokens, with code snippets, while minimizing documentation about themes files, which will be deprecated.
Motivation and context
Part of a larger docs improvement initiative to update documentation.
Related issue(s)
Author's checklist
I have reviewed at the Accessibility Practices for this feature, see: Aria PracticesI have added automated tests to cover my changes.I have included a well-written changeset if my change needs to be published.Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
1. Link validation
2. Code examples and imports
cssnotts)3. Terminology consistency
4. Markdown formatting and readability
Device review