I am building a block which has different layouts for mobile and desktop. As far as I understand CSS media queries, they work when the viewport is resized.
The preview feature in Gutenberg doesn't actually resize the viewport, it just reduces the width of the container containing the blocks.
I saw that the core Gutenberg block "Gallery" changes its layout when switched between desktop and mobile preview modes. I was wondering how that works? I checked the source code and even checked the Dev tools to detect any addition/removal of CSS classes but couldn't find any.
Can someone shed some light please?