Keeping styles out of scripts helps us code better. Much easier and deliberate coding when the javascript only adds or removes classes and the actual styles are in the css rather than inline.
Embedded Link
Building A Relationship Between CSS & JavaScript | Smashing Coding
This article shows how to open up lines of communication between CSS and JavaScript and lean on the strengths of each language.