const someStyle = css`
colors : ${({theme}) => theme.colors.primary;
${(props) => props.active ? css`
background-color: ${({theme}) => theme.colors.backgroundColorActive};
`}
`
const SomeButton = styled.div`
${someStyle}
`
Can I use css
template literals nested in another css template literals?
Even easier you can just use a simple Template strings:
const someStyle = `
color: ${({theme}) => theme.colors.primary;
${(props) => props.active ? `
background-color: ${({theme}) => theme.colors.backgroundColorActive};
`}
`
const SomeButton = styled.div`
${someStyle}
`