More Flexible Media Queries

I modify idea of Issue #2919