This pull request introduces a refactor to the ColorSwatch component by adding a backgroundColor prop that defaults to the color prop's value. This enhancement allows for the background color of the swatch to be different from the color value. Additonally the CSS stories have been updated to utilize CSS variables for the swatch background color. This change ensures a more accurate representation of CSS variables.
[x] I've clearly explained what problem this PR is solving and how it is solved.
[x] I've linked related issues
[x] I've included manual testing steps
[x] I've included screenshots/recordings if applicable
[x] I’ve included tests if applicable
[x] I’ve documented my code using JSDoc format if applicable
[x] I’ve applied the right labels on the PR.
[x] I’ve set the pull request status to "draft" and will update it to "ready for review" once all checks are passed.
Pre-merge reviewer checklist
[ ] I've manually tested the PR (e.g., pull and build branch, run the app, test code being changed).
[ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
Description
This pull request introduces a refactor to the
ColorSwatch
component by adding abackgroundColor
prop that defaults to thecolor
prop's value. This enhancement allows for the background color of the swatch to be different from the color value. Additonally the CSS stories have been updated to utilize CSS variables for the swatch background color. This change ensures a more accurate representation of CSS variables.Related issues
Fixes: https://github.com/MetaMask/design-tokens/issues/695
Manual testing steps
Screenshots/Recordings
Before
https://github.com/MetaMask/design-tokens/assets/8112138/a671b5f1-5b2a-40c9-a26e-da8396620cc2
After
https://github.com/MetaMask/design-tokens/assets/8112138/3733ccbc-5e68-49c9-9e8a-b5aa2c785a32
Pre-merge author checklist
Pre-merge reviewer checklist