Skip to content
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

feat(tokens): add spectrum and express to tokens package #2742

Merged
merged 8 commits into from
May 20, 2024

Conversation

castastrophe
Copy link
Collaborator

@castastrophe castastrophe commented May 9, 2024

Description

In preparation for our migration to a Spectrum 2-focused project, this PR adds component-specific theme assets to our token package. In this way, we are connecting the system overrides with a particular version of the token system (namely S1). When S1 content is removed, this will include removing the system theming approach entirely. By loading the theme and bridge assets for your component, you will be able to support S1 and S2 in parallel if you so wish (note that for this to work, you will still have to load both the S1 and S2 releases of the @spectrum-css/tokens package in tandem and with appropriate scoping).

In this PR we are adding 3 addition steps to our build process for only those components that support system theming:

  • Copy the <component-name>/themes/spectrum.css output to tokens/components/spectrum/<component-name>.css
  • Copy the <component-name>/themes/express.css output to tokens/components/express/<component-name>.css
  • Process the content from <component-name>/index.css with a referencesOnly = true flag for the Splintinator postcss plugin to output a new asset: tokens/components/bridge/<component-name>.css which will contain the mapping of component-specific custom properties to their --system prefixed pairing. This allows S2 base CSS to continue to work with S1 tokens (until a time that a new breaking change is released for that component).

How and where has this been tested?

Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.

Validation steps

Regression testing

Validate:

  1. The documentation pages for at least two other components are still loading, including:
  • The pages render correctly, are accessible, and are responsive.
  1. If components have been modified, VRTs have been run on this branch:
  • VRTs have been run and looked at.
  • Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.

Screenshots

To-do list

  • I have read the contribution guidelines.
  • I have updated relevant storybook stories and templates.
  • I have tested these changes in Windows High Contrast mode.
  • If my change impacts other components, I have tested to make sure they don't break.
  • If my change impacts documentation, I have updated the documentation accordingly.
  • ✨ This pull request is ready to merge. ✨

Copy link

changeset-bot bot commented May 9, 2024

🦋 Changeset detected

Latest commit: 170fb3e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@spectrum-css/tokens Minor
postcss-splitinator Minor
postcss-rgb-mapping Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented May 9, 2024

🚀 Deployed on https://pr-2742--spectrum-css.netlify.app

Copy link
Contributor

github-actions bot commented May 9, 2024

File metrics

Summary

Total size: 4.64 MB*
Total change (Δ): ⬆ 229.97 KB (5.08%)

Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.

Package Size Δ
tokens 202.98 KB ⬆ 3.77 KB

Details

tokens

File Head Base Δ
css/components/bridge/actionbutton.css 12.11 KB - 🎉 new
css/components/bridge/actiongroup.css 0.94 KB - 🎉 new
css/components/bridge/alertbanner.css 0.74 KB - 🎉 new
css/components/bridge/assetcard.css 0.73 KB - 🎉 new
css/components/bridge/button.css 35.72 KB - 🎉 new
css/components/bridge/checkbox.css 1.00 KB - 🎉 new
css/components/bridge/clearbutton.css 1.11 KB - 🎉 new
css/components/bridge/closebutton.css 1.03 KB - 🎉 new
css/components/bridge/combobox.css 1.08 KB - 🎉 new
css/components/bridge/datepicker.css 0.71 KB - 🎉 new
css/components/bridge/index.css 1.25 KB - 🎉 new
css/components/bridge/infieldbutton.css 1.94 KB - 🎉 new
css/components/bridge/picker.css 1.85 KB - 🎉 new
css/components/bridge/pickerbutton.css 1.73 KB - 🎉 new
css/components/bridge/popover.css 0.70 KB - 🎉 new
css/components/bridge/radio.css 1.54 KB - 🎉 new
css/components/bridge/rating.css 0.97 KB - 🎉 new
css/components/bridge/search.css 2.01 KB - 🎉 new
css/components/bridge/slider.css 2.09 KB - 🎉 new
css/components/bridge/stepper.css 2.99 KB - 🎉 new
css/components/bridge/switch.css 1.49 KB - 🎉 new
css/components/bridge/tabs.css 0.69 KB - 🎉 new
css/components/bridge/tag.css 3.51 KB - 🎉 new
css/components/bridge/textfield.css 1.17 KB - 🎉 new
css/components/bridge/toast.css 0.71 KB - 🎉 new
css/components/bridge/tooltip.css 0.73 KB - 🎉 new
css/components/express/actionbutton.css 9.01 KB - 🎉 new
css/components/express/actiongroup.css 0.90 KB - 🎉 new
css/components/express/alertbanner.css 0.74 KB - 🎉 new
css/components/express/assetcard.css 0.70 KB - 🎉 new
css/components/express/button.css 29.64 KB - 🎉 new
css/components/express/checkbox.css 0.92 KB - 🎉 new
css/components/express/clearbutton.css 1.00 KB - 🎉 new
css/components/express/closebutton.css 0.93 KB - 🎉 new
css/components/express/combobox.css 1.00 KB - 🎉 new
css/components/express/datepicker.css 0.70 KB - 🎉 new
css/components/express/index.css 1.25 KB - 🎉 new
css/components/express/infieldbutton.css 1.65 KB - 🎉 new
css/components/express/picker.css 1.49 KB - 🎉 new
css/components/express/pickerbutton.css 1.49 KB - 🎉 new
css/components/express/popover.css 0.66 KB - 🎉 new
css/components/express/radio.css 1.33 KB - 🎉 new
css/components/express/rating.css 0.99 KB - 🎉 new
css/components/express/search.css 1.92 KB - 🎉 new
css/components/express/slider.css 1.76 KB - 🎉 new
css/components/express/stepper.css 2.32 KB - 🎉 new
css/components/express/switch.css 1.26 KB - 🎉 new
css/components/express/tabs.css 0.69 KB - 🎉 new
css/components/express/tag.css 3.28 KB - 🎉 new
css/components/express/textfield.css 1.06 KB - 🎉 new
css/components/express/toast.css 0.72 KB - 🎉 new
css/components/express/tooltip.css 0.73 KB - 🎉 new
css/components/spectrum/actionbutton.css 9.20 KB - 🎉 new
css/components/spectrum/actiongroup.css 0.79 KB - 🎉 new
css/components/spectrum/alertbanner.css 0.74 KB - 🎉 new
css/components/spectrum/assetcard.css 0.69 KB - 🎉 new
css/components/spectrum/button.css 29.71 KB - 🎉 new
css/components/spectrum/checkbox.css 0.91 KB - 🎉 new
css/components/spectrum/clearbutton.css 0.97 KB - 🎉 new
css/components/spectrum/closebutton.css 0.92 KB - 🎉 new
css/components/spectrum/combobox.css 0.99 KB - 🎉 new
css/components/spectrum/datepicker.css 0.69 KB - 🎉 new
css/components/spectrum/index.css 1.25 KB - 🎉 new
css/components/spectrum/infieldbutton.css 1.67 KB - 🎉 new
css/components/spectrum/picker.css 1.58 KB - 🎉 new
css/components/spectrum/pickerbutton.css 1.45 KB - 🎉 new
css/components/spectrum/popover.css 0.68 KB - 🎉 new
css/components/spectrum/radio.css 1.32 KB - 🎉 new
css/components/spectrum/rating.css 1.01 KB - 🎉 new
css/components/spectrum/search.css 1.82 KB - 🎉 new
css/components/spectrum/slider.css 1.73 KB - 🎉 new
css/components/spectrum/stepper.css 2.28 KB - 🎉 new
css/components/spectrum/switch.css 1.26 KB - 🎉 new
css/components/spectrum/tabs.css 0.68 KB - 🎉 new
css/components/spectrum/tag.css 3.30 KB - 🎉 new
css/components/spectrum/textfield.css 1.05 KB - 🎉 new
css/components/spectrum/toast.css 0.72 KB - 🎉 new
css/components/spectrum/tooltip.css 0.73 KB - 🎉 new
css/dark-vars.css 25.19 KB 24.57 KB ⬆ 0.63 KB (2.50%)
css/darkest-vars.css 25.14 KB 24.53 KB ⬆ 0.63 KB (2.50%)
css/express/custom-dark-vars.css 1.11 KB 0.59 KB ⬆ 0.55 KB (93.37%)
css/express/custom-darkest-vars.css 1.11 KB 0.59 KB ⬆ 0.55 KB (92.89%)
css/express/custom-large-vars.css 1.10 KB 0.50 KB ⬆ 0.63 KB (124.90%)
css/express/custom-light-vars.css 1.15 KB 0.63 KB ⬆ 0.55 KB (87.12%)
css/express/custom-medium-vars.css 1.09 KB 0.48 KB ⬆ 0.63 KB (129.28%)
css/express/custom-vars.css 0.67 KB 0.04 KB ⬆ 0.63 KB (1492.86%)
css/express/global-vars.css 3.00 KB 2.39 KB ⬆ 0.63 KB (25.59%)
css/express/large-vars.css 3.13 KB 2.52 KB ⬆ 0.63 KB (24.32%)
css/express/medium-vars.css 3.13 KB 2.51 KB ⬆ 0.63 KB (24.35%)
css/global-vars.css 38.84 KB 38.23 KB ⬆ 0.63 KB (1.60%)
css/large-vars.css 25.01 KB 24.40 KB ⬆ 0.63 KB (2.51%)
css/light-vars.css 25.17 KB 24.55 KB ⬆ 0.63 KB (2.50%)
css/medium-vars.css 24.95 KB 24.33 KB ⬆ 0.63 KB (2.52%)
css/spectrum/custom-dark-vars.css 3.88 KB 3.40 KB ⬆ 0.49 KB (14.00%)
css/spectrum/custom-darkest-vars.css 3.88 KB 3.40 KB ⬆ 0.49 KB (14.02%)
css/spectrum/custom-large-vars.css 5.18 KB 4.68 KB ⬆ 0.52 KB (10.77%)
css/spectrum/custom-light-vars.css 3.88 KB 3.40 KB ⬆ 0.49 KB (13.99%)
css/spectrum/custom-medium-vars.css 5.43 KB 4.92 KB ⬆ 0.52 KB (10.24%)
css/spectrum/custom-vars.css 2.58 KB 2.04 KB ⬆ 0.56 KB (26.86%)
css/spectrum/global-vars.css 3.35 KB 2.74 KB ⬆ 0.63 KB (22.34%)
css/spectrum/large-vars.css 2.93 KB 2.32 KB ⬆ 0.63 KB (26.37%)
css/spectrum/medium-vars.css 2.93 KB 2.32 KB ⬆ 0.63 KB (26.42%)
index.css 199.24 KB 199.21 KB ⬆ 0.04 KB (0.02%)
* Size determined by adding together the size of the main file for all packages in the library.
* Results are not gzipped or minified.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

@castastrophe castastrophe force-pushed the feat-s1-express-assets-to-tokens branch from 697435f to c82818b Compare May 9, 2024 14:50
@castastrophe castastrophe self-assigned this May 9, 2024
@castastrophe castastrophe force-pushed the feat-s1-express-assets-to-tokens branch 5 times, most recently from 08529db to 754d5b0 Compare May 9, 2024 16:51
.gitignore Show resolved Hide resolved
Copy link
Collaborator

@pfulton pfulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get that pre-release rollin'

@castastrophe castastrophe force-pushed the feat-s1-express-assets-to-tokens branch 3 times, most recently from 96c2ce5 to 4078e32 Compare May 13, 2024 20:53
@castastrophe castastrophe added the run_vrt For use on PRs looking to kick off VRT label May 13, 2024
@castastrophe castastrophe force-pushed the feat-s1-express-assets-to-tokens branch from 4078e32 to 92f5e39 Compare May 13, 2024 20:56
@castastrophe castastrophe marked this pull request as ready for review May 20, 2024 15:58
@castastrophe castastrophe force-pushed the feat-s1-express-assets-to-tokens branch 3 times, most recently from 45cebeb to c916451 Compare May 20, 2024 16:11
@castastrophe castastrophe force-pushed the feat-s1-express-assets-to-tokens branch from c916451 to 170fb3e Compare May 20, 2024 16:13
@castastrophe
Copy link
Collaborator Author

SWC branch: adobe/spectrum-web-components#4442

@pfulton pfulton merged commit 1e74ab7 into main May 20, 2024
13 checks passed
@pfulton pfulton deleted the feat-s1-express-assets-to-tokens branch May 20, 2024 16:55
@github-actions github-actions bot mentioned this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review run_vrt For use on PRs looking to kick off VRT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants