I have a demo here
Its a simple react app where I'm using Styled Components with a theme
The theme is like
import { DefaultTheme } from "styled-components";
export const theme: DefaultTheme = {
sizes: {
height: "50px",
width: "50px"
}
};
Is it possible to use the theme values with arithmetic operations in the styled component
So something like
height: ${({ theme }) => theme.sizes.height}+
${({ theme }) => theme.sizes.height};
This doesn't work in my demo but I didn't know if the syntax was incorrect or its just not possible.
"50px" + "50px"= "50px50px". - Brian Thompson