MetaMask / design-tokens

Design tokens to be used throughout MetaMask products
https://metamask.github.io/design-tokens/?path=/docs/getting-started-introduction--docs
28 stars 15 forks source link

fix: css stories use css variables instead of static color values #696

Closed georgewrmarshall closed 4 months ago

georgewrmarshall commented 4 months ago

Description

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.

Related issues

Fixes: https://github.com/MetaMask/design-tokens/issues/695

Manual testing steps

  1. Go to the storybook build of this PR
  2. Go to the CSS stories for brand color, light theme and dark theme
  3. Verify the swatches are using the CSS variable and not the static color value
  4. Ensure other stories are still rendering correctly for Figma and JS

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