In my projects I used some global css variables like --space-unit, --header-height and other. And it looked like this :
--space-unit: 10px;
--header-height: 70px;
@media (max-width: 991px) {
--space-unit: 7px;
--header-height: 40px;
}
@media (max-width: 991px) {
--space-unit: 5px;
}
And for different screen resolutions, the variables were appropriate. how do I implement this with styled-components? That is, I create ThemeProvider, enter the initial values of spaceUnit and headerHeight in it, but how do I dynamically change it later?