Adaptive-Web-Components
Adaptive-Web-Components copied to clipboard
AUI: Refactored Swatch to Color
Pull Request
Description
The primary goal here is to refactor color-type design tokens to support gradients.
The secondary goal was to align design token terminology around "Color" and to subsume the opacity capability that was in "Swatch".
The "Swatch" term has been around for a while and the original meaning comes from the collection of colors (swatches) in a Palette. From a token perspective this was more confusing.
Reviewer Notes
The bulk of the change is a rename from Swatch to Color. The Paint class is introduced as the parent of Color and eventually the parent of Gradient. The design token working group is missing the abstraction that both a solid color and a gradient can often be used in the same ways. This resolves that.
Test Plan
Tested in the Designer plugin and all web apps in this project.
Checklist
General
- [x] I have included a change request file using $ npm run change
- [x] I have added tests for my changes.
- [x] I have tested my changes.
- [ ] I have updated the project documentation to reflect my changes.
- [x] I have read the CONTRIBUTING documentation for this project.
⏭ Next Steps
As mentioned, the immediate next step is to add Gradient support.
Also I will rename some of the color recipes including the file name, but that felt difficult with the changes that were already in place.
There are probably some migrations to Color which will be further generalized to Paint, but I want to revisit that when the need arises to make sure I don't over index on everything being Paint.