Open keithjgrant opened 5 years ago
I think this sort of thing can cover a lot of layout-changing container queries. The trick is finding a way to apply the same sort of switch to font size and colors. Unfortunately, using percent in a calc()
means something different for different properties, so this seems to only be applicable to properties like width
and flex-basis
.
Heydon Pickering recently posted a great trick for making a flex items wrap below a breakpoint and display inline above the breakpoint — and the breakpoint is dependent on container width, not viewport. The trick involves using
calc()
to forceflex-basis
to be either an arbirarily low negative or high positive value.This is one particular case of container queries, solved using today’s CSS. I know that, using flexbox & grid, there are a few other specific cases that can be accomplished as well. In fact, I believe his technique can be used to solve the specific use-case given in our Use Cases document.
This leaves me with two questions: