I have this code:
@media screen and (max-width: 570px) {
#header {
.flex-wrap(wrap);
.justify-content(center);
#headerTitles {
margin-top: 1rem;
}
}
}
@media screen and (min-width: 571px) and (max-width: 950px) {
#header.authenticated {
.flex-wrap(wrap);
.justify-content(center);
#headerTitles {
margin-top: 2rem;
}
}
}
Is there a way that I can use Javascript (not jQuery) to dynamically add or remove a class to the to represent the two different sizes and then recode this something like:
.small #headerTitles { margin-top: 1rem; }
.large #headerTitles { margin-top: 2rem; }
If this works then can someone comment as to if using Javascript is a better way to do this?