The World's Smallest Container Query Plugin
Define a 'container' using a CSS selector, run a JavaScript test on matching HTML elements, and apply CSS styles to the container or its child elements if the test resolves true.
q(containerList, condition, childList, rule)containerListis a comma-separated string containing one or more CSS selectorsconditionis a JavaScript test that should evaluate totrueorfalsechildListis a comma-separated string containing one or more CSS selectorsruleis a semicolon-separated string containing one or more CSS declarations
q('div', 'this.offsetWidth > 500', 'span', 'background: lime')This plugin lovingly golfed by: