Exactly, the problem becomes managing view logic in conjunction with @media queries. If you app fundamentally changes how it works and how it looks, you're stuck managing that logic in 2 places. You don't want to manage the view logic in JS and you can't manage the application logic in CSS without some kind of standard system. That was the goal for MoshPit, to integrate easily and allow management of both at the CSS layer.
You don't have to
if (window.is_mobile() && this.$left_thing.css('display') == 'block') {
this.$left_thing.hide();
this.$right_thing.show();
} else if (window.is_tablet() && this.$left_thing.css('display' == 'block') {
this.$left_thing.css('left','-100px');
this.$right_thing.show().css('left','0');
} else if (i_hate_my_life) ...
Because managing it in the code, through QA, and receiving the email subject line:
"We're adding a new component to the application, it will only be shown like this when this thing is happening and on mobile it will be able to show here, but not here, only if this thing is shown, and since it' launches from this we'll need these things to do this."
Doesn't cause more nested if else switch case statements to further complicate the code.
You don't have to
Because managing it in the code, through QA, and receiving the email subject line:"We're adding a new component to the application, it will only be shown like this when this thing is happening and on mobile it will be able to show here, but not here, only if this thing is shown, and since it' launches from this we'll need these things to do this."
Doesn't cause more nested if else switch case statements to further complicate the code.