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