Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
What do we want to be able to query? #43
Element width, is an obvious one.
There are use cases for all of these things. What's practical to require from the start, and how should the door be kept open for queries of the future?
I think I’d want to keep this first pass focused on width/height—that way we can work out the mechanism for container queries without needing to figure out/spec a whole mess of specific features up front.
That said, we should probably get the idea of future query-able features into the use cases doc, so we don’t run the risk of locking the mechanism itself into width/height only.
I've experimented with many different breakpoints, but I keep coming back to this core set of features:
I've implemented these features in a few different plugins so you can see how it can work and what CSS + JS are required to make it work right now in the meantime. Hopefully standardization can solidify some of these approaches into something that works!
I would also like to note - 'number of lines of text' turns out to be less useful as a responsive breakpoint in practice than it might appear at first. Even when you're dealing with numbers of lines of text in a layout, the solution often lies in knowledge of characters and/or the width of the element.