-
Notifications
You must be signed in to change notification settings - Fork 235
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
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!
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. |
b50d061 to
4d0d3c2
Compare
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!
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.
1st-gen/tools/styles/README.md
Outdated
|
|
||
| Here is a summary of each system and the options available on each: | ||
|
|
||
| <sp-table> |
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.
| "./src/spectrum-body.css": "./src/spectrum-body.css", | ||
| "./src/spectrum-code.css": "./src/spectrum-code.css", | ||
| "./src/spectrum-detail.css": "./src/spectrum-code.css", | ||
| "./src/spectrum-detail.css": "./src/spectrum-detail.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.
We can thank Cursor for this one
📚 Branch Preview Links🔍 First Generation 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 |
|
|
||
| ```css | ||
| /* pick a color option */ | ||
| /* pick a color option from: */ |
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 threw these import examples into tabs so that a reader could more easily ignore them/go to the system they want. Since I removed the documentation about all of the available colors/scales on each system I had before (a table, and before that some bullets), I'm adding more imports to demonstrate all the available options. Happy to have feedback on this.
| #### Token usage example | ||
|
|
||
| Which tokens files you import will depend on which tokens you want to use. | ||
| Which tokens files you import will depend on which tokens you want to use. Here's one example of tokens usage in a non-web-component context, showing how custom properties from each file work together. This will vary slightly depending on which system's tokens are being used. |
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've kept this example the mostly the same as it was, in the tabs. If the h5s behaved the way we would want them to, that would have been a better structure for them. Open to ideas here too.
1st-gen/tools/styles/README.md
Outdated
| 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 Spectrum 2 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);`). | ||
|
|
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.
Took this paragraph out and there are sections for global, scale, and color now instead, and each has bullets with examples. I'm hoping that's clearer.
caseyisonit
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.
LGTM
- Indentation fixes - Core tokens link fix - Use "Spectrum 2 tokens" rather than "v2-tokens" or "tokens-v2" - Adjust imports and comments in example
This reverts commit 6a63a69.
388e8da to
b78c1f3
Compare


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