Use array scales with themeGet
December 1, 2020 at 1:21pmUse array scales with themeGet
December 1, 2020 at 1:21pmUsing
themeGet
, I am trying to achieve this:const Box = styled.div`${typography};`;const Test = () => <Box fontSize={["2xl", "xl", "base"]}>Box</Box>;
But using array in themeGet don't work:
const Box = styled.div`font-size: ${themeGet(["fontSizes.2xl", "fontSizes.xl", "fontSizes.base"])}px;`;const Test = () => <Box>Box</Box>;
February 23, 2021 at 9:36pm
Try using this package https://www.npmjs.com/package/better-theme-get