marcj / css-element-queries

CSS Element-Queries aka Container Queries. High-speed element dimension/media queries in valid css.
http://marcj.github.io/css-element-queries/
MIT License
4.27k stars 487 forks source link

Can't have multiple classes using element queries #311

Open andi-b opened 3 years ago

andi-b commented 3 years ago

If I have a media query against one class and another media query against another class, if the element has both classes, it will only apply the second media query. I've created a JS fiddle to demonstrate:

https://jsfiddle.net/bambeck/L7fj4qyp/

I have a solution where by instead of passing an id (single class) to the function SetupInformation(element, id), I loop through the element's classes (this.element.classList). I'm unsure what the fallout could be but it seems to work.