Free browser QR studio, zero login
Generates sharp SVG and PNG codes right inside your browser tab. No account wall, no redirect links, and no monthly fee for plain squares.
Waffle fry · 2026-11-22
A CSS container query lets a component respond to the width of its own box instead of the whole browser screen, so one card works cleanly in a narrow sidebar or a wide grid. Pair size rules with CSS style queries and a single custom property can switch layouts and themes with zero JavaScript.
Stop rewriting viewport breakpoints every time a card moves into a sidebar.
Pick a preset width below (or drag the bottom-right corner on desktop) and toggle --variant to test container size queries and container style queries together — zero JavaScript.
Free browser QR studio, zero login
Generates sharp SVG and PNG codes right inside your browser tab. No account wall, no redirect links, and no monthly fee for plain squares.
Desktop tip: drag the coral corner handle on the box above to scrub smoothly across every breakpoint.
Traditional @media rules only know how wide the whole browser window is. Drop the same product card into a wide hero and a tight sidebar on the same desktop page, and a media query cannot tell them apart.
With CSS container queries, you mark a parent wrapper with container-type: inline-size. Every child inside can then query that wrapper's width, scale text smoothly with cqw and cqi container query units, and read custom properties with @container style(--variant: featured).
Hides the decorative square graphic and tightens padding so the card fits inside tight rails and phone columns.
Reveals the emblem strip above the text and opens up spacing while fluid cqi type grows smoothly.
Switches to a two-column grid with the graphic anchored on the left beside full copy and metadata.
Reads one custom property on the container to swap into the gold featured look or dashed compact mode.
/* 1. Turn the wrapper into a named inline-size container */
.card-slot {
container-type: inline-size;
container-name: card;
}
/* 2. Adapt the card to its own box width, plus fluid cqi type */
.item-card {
display: grid;
gap: 0.75rem;
padding: 1rem;
}
.item-card h3 {
font-size: clamp(1.05rem, 4.5cqi, 1.55rem);
}
@container card (min-width: 340px) {
.item-card { padding: 1.25rem; }
.item-card .meta { display: flex; gap: 0.6rem; }
}
@container card (min-width: 540px) {
.item-card {
grid-template-columns: 11rem 1fr;
align-items: center;
gap: 1.35rem;
}
}<div class="card-slot is-featured">
<article class="item-card">
<div class="thumb" aria-hidden="true">QR</div>
<div class="body">
<span class="badge">Browser tool</span>
<h3>Bandit Codes</h3>
<p class="blurb">Build SVG and PNG codes locally with no login.</p>
<p class="meta">Zero uploads · MIT code</p>
</div>
</article>
</div>/* 3. Flip inner card looks with CSS style queries (Baseline 2026) */
.card-slot.is-featured {
--variant: featured;
}
.card-slot.is-compact {
--variant: compact;
}
@container card style(--variant: featured) {
.item-card {
border-color: #ffc857;
background: #2b1840;
}
.item-card .badge {
background: #ffc857;
color: #170c26;
}
}
@container card style(--variant: compact) {
.item-card {
padding: 0.85rem 1rem;
border-style: dashed;
}
.item-card .blurb { display: none; }
}Browser support (checked 2026-11-22): Container size queries (container-type: inline-size, @container, and cqw/cqi units) are Baseline Widely Available across Chrome 105+, Edge 105+, Safari 16+, and Firefox 110+ (Web Platform Dashboard: container-queries). Custom-property container style queries (@container style(--prop: val)) became Baseline Newly Available in May 2026 across Chrome 111+, Edge 111+, Safari 18+, and Firefox 151+ (Web Platform Dashboard: container-style-queries). Older browsers ignore the style query rules and keep the default card look. Tested in Chromium only.
The fine print, in plain words
We're raccoons who think simple things shouldn't cost a monthly fee. We take techniques apart, explain them in plain words, and give them away. The code on this page is MIT licensed: copy it, change it, and share it.
This is one of twelve experiments so far. Our first browser tool (Bandit Codes) is live now, and the rest sit as ideas in the stash.
Next snack
Open, animate from display: none, and close a native modal using commandfor and @starting-style.
$ open ./stash
The stash is open. Take what you need.
Every snippet in the lab is yours under MIT. No account. No catch.