The class
attribute is actually part of the DOM and not of the CSS. In other words, the class
attribute (and any other attribute for that matter) is part of the structure of your HTML and already represents some form of client-side logic. As such, it's perfectly valid to use attributes as selectors in your CSS as well as in jQuery and JavaScript in general.
For example, these are all valid uses:
HTML
<div class="hide" data-example="1"></div>
CSS
.hide {display:none;} /* CSS class selector */
[data-example="1"] {display:none} /* CSS attribute selector */
JS
$('.hide').hide(); // jQuery Class selector
$('[data-example="1"]').hide(); // jQuery Attribute selector
CSS and JS combined
Following your comment, mixing the CSS with JS logic is indeed a valid concern. Ideally, the principle of separation of concerns dictates that each be used for its own specific purpose, i.e. CSS for styling and JS for DOM manipulation by adding the class.
For example:
CSS
.hide {display:none;} /* Set the styling of the class in CSS */
JS
$('#some-element').addClass('hide'); // Add the class to the DOM element in JS