The Devil's Albatross: Layout Breakpoints Without Media Queries
Nils Binder has published a technique for controlling the spacing between two elements as available room shrinks. The example: a large-screen header with a logo top-left and navigation top-right. On a smaller screen the two can no longer share a row, and when they wrap they end up centered rather than simply stacked.
Binder includes a video demonstrating the behavior.
The obvious approach is to pick the exact pixel width where the change should occur and write a media query to restyle the elements there. The catch is that media queries respond only to the width of the entire browser window. For a full-site header that may be fine, but the desire to avoid writing media queries is understandable.
Binder's method borrows concepts from Heydon's Holy Albatross to achieve the effect without any media queries at all. That makes the technique usable on a small-scope component whose breaking point should follow its own size rather than the size of the browser window.
More details, including the video, are available in Binder's post.



