In this case, CSS is shorter (229 characters VS 222) and easier to follow (subjective). Furthermore, in CSS you’d use a preprocessor to make it even shorter and grouped, e.g.
Stop using CSS in JavaScript for web development
Gajus Kuizinas

I suggest you to show an example based on attributes instead of classes. Css status shoud be use the aria-* attributes o normal attributes. So.. .button[aria-primary] is a better example ☺

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.