Open hshoja opened 2 years ago
Try use native css variable instead.
:root {
--primary-color: var(@primary-color);
// other global variables
}
const StyledButton = styled(Button)`
background-color: --primary-color;
`
Try use native css variable instead.
Map with less variables:
:root { --primary-color: var(@primary-color); // other global variables }
const StyledButton = styled(Button)` background-color: --primary-color; `
I used this approach, but we have to define it twice.
I would like to be able to access the Ant Design variables (which are written in Less) within a styled component. Something like this:
how can I achieve this?