I need container queries!
-
Have you considered another design aspect that doesn't require queries?
-
No:
Try this first, there may be a manner in which you can solve the same problem without needing any container query approach.
-
Yes:
Move onto the next item
-
Is the container you're querying always a specific percentage to the viewport?
-
Yes:
Then use a media query
-
No:
Move on to the next item
-
Does the query depend on its child's size?
-
No:
Move on to the next item
-
Yes:
Move to
this item
-
Does your container need access to the parent document (eg: access to CSS custom properties within that document)?
-
No:
Use an iframe
-
Yes:
Move on to the next item
-
Will your query change layout
-
No:
Move to the
this item
-
Yes:
Try to use modern layout such as Grid or Flexbox
-
Did the modern layout work?
-
No:
Move to the next item
-
Yes:
Sweet!
-
Is the scenario primarily impacted by content overflowing?
-
Yes:
Then use the IntersectionObserver technique
-
No:
Then use resizeObserver