I’ve just done a quick test and can confirm that container queries work in themes… one thing I will note is that they’re a lot harder to reason around than media queries. A couple of us on the team have been confused by this initially.
They’re not simply media queries on containers, but have a separate set of requirements. The biggest issue being:
Size containment turns off the ability of an element to get size information from its contents, which is important for container queries to avoid infinite loops.
So you can not use a container query with a container that has a dynamic width. You must set a static width on the container. This significantly limits what you’d expect to be able to do with them unfortunately.
Here's a really goofy proof of concept that shows that they work
I believe I’ve isolated my issue: containers can’t be tables, looks like they must be divs.
I created a pen which had two identical containers, except one was a table.
The container query fails on the table, but succeeds on the otherwise almost identical div.
the ultimate solution here was moving the container up to #list-area which is a div and that solved my issue!
Really appreciate you looking at this, because confirming it should work in themes (to the extent that it does) gave me that all-important extra impetus!