AbsurdJS Media Query
HTML
<script src="https://raw.githubusercontent.com/krasimir/absurd/master/client-side/build/absurd.js"></script>
<script src="https://raw.githubusercontent.com/krasimir/absurd/master/client-side/build/absurd.organic.js"></script>
<body>
</body>
JavaScript
var absurd = Absurd();
absurd.component('MyComp', {
html: { div: 'Test' },
css: { div: { color: '#f00' }},
ready: function(dom, mq) {
this.set('parent', dom('body').el).populate();
mq('all and (min-width: 300px)', function(match) {
if(match) {
this.css.div.backgroundColor = '#0f0';
this.html.div = 'More then 300px';
} else {
this.css.div.backgroundColor = '#f00';
this.html.div = 'Less then 300px';
}
this.populate();
}, true);
}
})();