ahume/selector-queries

Adding multiple classes?

Closed this issue · 1 comments

How do I go about doing the following?

Basically trying to add class ' eight, columns, eight-smaller ' 3 separate classes.

There's two ways this could work. Either add the rule multiple time for each class name:

<div class="" data-squery="min-width:400px=eight min-width:400px=columns min-width:400px=eight-smaller">

Or, probably better is to use the JS method of adding these (which isn't documented in the readme). It works like this:

var els = document.querySelectorAll(".menu");
SelectorQueries.add(els, "min-width", "30em", "wide");
SelectorQueries.ignoreDataAttributes(); // Don't parse the document for data-squery

So you should be able to do:

SelectorQueries.add(my_div, "min-width", "400px", "eight columns eight-smaller");

All untested, but worth a try.