webgl-components
Build small, always-on WebGL visuals (identity avatars, ambient orbs, glass and iridescent surfaces, animated textures) that ship…
Enforce Tailwind container queries over viewport breakpoints for responsive components. Use when writing or reviewing responsive Tailwind code, when a component needs to adapt to its available space (cards, sidebars, lists, panels, anything reused in different layouts), or when
$ npx -y skills add flornkm/skills --skill prefer-container-queries --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/prefer-container-queriesContext preview
The summary Claude sees to decide when to auto-load this skill.
Enforce Tailwind container queries over viewport breakpoints for responsive components. Use when writing or reviewing responsive Tailwind code, when a component needs to adapt to its available space (cards, sidebars, lists, panels, anything reused in different layouts), or when
name: prefer-container-queries description: "Enforce Tailwind container queries over viewport breakpoints for responsive components. Use when writing or reviewing responsive Tailwind code, when a component needs to adapt to its available space (cards, sidebars, lists, panels, anything reused in different layouts), or when migrating sm:/md:/lg: classes to @container variants."
Components should respond to the space they are in, not to the viewport. A card that lives in a sidebar has maybe 300px of width even on a huge screen, and a viewport breakpoint like `md:flex-row` will get that wrong every time. Container queries fix this: the component asks "how wide am I?" instead of "how wide is the window?".
When writing responsive Tailwind, default to container queries. Viewport breakpoints are the exception, not the rule.
Mark the parent as a container, then use `@`-prefixed variants on its children:
<div class="@container">
<div class="flex flex-col @md:flex-row @md:gap-6">
<img class="w-full @md:w-48" />
<div class="@md:flex-1">...</div>
</div>
</div>`@md:` here means "when the container is at least 28rem wide", regardless of viewport size. This card works in a sidebar, a modal, and a full-width grid without changing a single class.
Two rules that trip people up:
1. The `@container` class goes on the parent. The `@md:` variants go on descendants. An element cannot query its own size. 2. Container variants respond to the nearest ancestor with `@container`. If styles are not applying, check which container you are actually querying.
Tailwind v4 ships container queries in core. The sizes:
| Variant | Min width | | --- | --- | | `@3xs` | 16rem (256px) | | `@2xs` | 18rem (288px) | | `@xs` | 20rem (320px) | | `@sm` | 24rem (384px) | | `@md` | 28rem (448px) | | `@lg` | 32rem (512px) | | `@xl` | 36rem (576px) | | `@2xl` | 42rem (672px) | | `@3xl` | 48rem (768px) | | `@4xl` | 56rem (896px) | | `@5xl` | 64rem (1024px) | | `@6xl` | 72rem (1152px) | | `@7xl` | 80rem (1280px) |
Also available:
The full docs for this can be found [here](https://tailwindcss.com/docs/responsive-design#container-queries).
On Tailwind v3, the same syntax needs the `@tailwindcss/container-queries` plugin. Check the Tailwind version before writing classes.
Do not convert these:
Everything inside those layout regions, meaning cards, forms, media objects, stat blocks, table-to-list switches, should use container queries.
1. Find the component's responsive classes (`sm:`, `md:`, `lg:`). 2. Add `@container` to the component's root or the wrapper that owns the available space. 3. Replace viewport variants with the container variant that matches the actual width where the layout should change. Do not map `md:` to `@md:` blindly; `md` is 768px of viewport, `@md` is 448px of container. Resize the container, not the window, to find the real breakpoint. 4. Test the component in its narrowest real context (sidebar, drawer, small grid cell), not just at mobile viewport widths.
There are plenty of skills out there. This library avoids slop and only ships skills that: teach agents concepts LLMs aren't trained on, because they are new or rarely used encode specific, opinionated workflows, validated across multiple codebases
Build small, always-on WebGL visuals (identity avatars, ambient orbs, glass and iridescent surfaces, animated textures) that ship…