menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

styled-system

Style props for rapid UI development

Channels
Team

Use array scales with themeGet

December 1, 2020 at 1:21pm

Use array scales with themeGet

December 1, 2020 at 1:21pm
Using 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