build log
one card, every width
no media queries here: the card asks its container how much room it has, and the theme and density are just variables.
read more~/skills/html-css
everything on the web ends up here eventually, including this site.
semantic markup, custom properties, container queries and nothing clever in JavaScript. the card on the right is styled by the CSS on the left.
used in CHC Review Studio
html / css · styled by the css it shows
build log
no media queries here: the card asks its container how much room it has, and the theme and density are just variables.
read more.demo-frame[style] {
--frame-w: 420px;
--spacing: 1;
--card-radius: 14px;
--card-border-w: 1px;
--type-scale: 1;
}
data-theme="light" data-density="normal"
data-align="start" data-shadow="none"tab + arrows slidersclick a preset for quick widths
the controls only write custom properties and data attributes. the card is the markup in card.html, adapting through app/demo-card.css: variables for the numbers, a container query for the layout. the one thing the lab will not stop you doing is making it worse.
<!-- the lab sets the data-* attributes and the style attribute; the card never changes. --><div class="demo-frame" data-theme="light" data-density="normal" data-align="start" data-shadow="none" style="--frame-w: 420px; --spacing: 1; --card-radius: 14px"> <article class="demo-card" aria-labelledby="demo-card-title"> <div class="demo-card-art" aria-hidden="true"></div> <div class="demo-card-body"> <p class="demo-card-kicker">build log</p> <h3 id="demo-card-title">one card, every width</h3> <p>no media queries here: the card asks its container how much room it has, and the theme and density are just variables.</p> <ul class="demo-card-tags"> <li>semantic</li> <li>container queries</li> <li>custom properties</li> </ul> <a class="demo-card-link" href="#demo-card-title">read more</a> </div> </article></div>