big-design icon indicating copy to clipboard operation
big-design copied to clipboard

Default theme uses singleton instance of `themeOptions`

Open chanceaclark opened this issue 3 years ago • 0 comments

Describe the bug @bigcommerce/big-design-theme uses singleton instance of themeOptions. This can cause issues if we want to create two separate themes with different font-sizes.

To Reproduce Codesandbox to replicate the issue: https://codesandbox.io/s/delicate-thunder-7ih0r?file=/src/index.tsx

The first box in the codesandbox is being remCalc'd to 48px but you can see the calculation is using the 14px font-size for the calculation.

Expected behavior Each theme should have it's own instance of themeOptions to ensure font-sizes and potential future options don't clash with another themes.

Screenshots N/A

Desktop (please complete the following information, if applicable): N/A

Smartphone (please complete the following information, if applicable): N/A

Additional context N/A

chanceaclark avatar Oct 13 '21 15:10 chanceaclark