-
So you've written a component that responds to the width of external containers, wherever you put it, using a container query. But then someone uses your component on a page without defined containers. 😱 The container query should:
-
I go back and forth on this. - External containers are never exact, but we should use the best info we have available! - Desktop viewport width is often much larger than any containers, the default layout is probably safer. Authors can add root containment explicitly if needed!
-
If we use a mobile-first approach (small-view default, larger-view queries), mobile layouts will likely "just work". But on larger screens, we'd have two potential broken states: - oops, plenty of space, small (default) view - oops, narrow space, large (viewport) view
-
I keep almost being convinced about the viewport fallback, but then I look at actual examples, and the default always looks better to me as a progressive fallback: MiriSuzanne/1387553519213764608