Ten rules for calmer interfaces
Mar 12 · 5 min read
A social media post embed with avatar, name, handle, post text, timestamp and like count for testimonial walls.
Dana Vu@danavu
Shipped our new pricing page with zero JavaScript. CSS :has() is doing all the heavy lifting.
<article class="post-embed">
<header>
<span class="post-embed-avatar" aria-hidden="true">DV</span>
<p><strong>Dana Vu</strong><span>@danavu</span></p>
</header>
<p>Shipped our new pricing page with zero JavaScript. CSS :has() is doing all the heavy lifting.</p>
<footer>
<time datetime="2026-11-03T14:14">2:14 PM · Nov 3, 2026</time>
<span><span aria-hidden="true">♥</span> 248 likes</span>
</footer>
</article>
.post-embed {
width: 270px;
padding: 14px 16px;
border: 1px solid #e0f2fe;
border-radius: 16px;
background: #fff;
color: #0f172a;
font-family: system-ui, sans-serif;
}
.post-embed header {
display: flex;
align-items: center;
gap: 10px;
}
.post-embed-avatar {
display: grid;
place-items: center;
width: 38px;
height: 38px;
border-radius: 50%;
background: linear-gradient(135deg, #38bdf8, #0369a1);
color: #fff;
font-size: 13px;
font-weight: 700;
}
.post-embed header p {
display: grid;
margin: 0;
font-size: 14px;
line-height: 1.25;
}
.post-embed header p span {
color: #64748b;
font-size: 13px;
}
.post-embed > p {
margin: 10px 0;
font-size: 14px;
line-height: 1.5;
}
.post-embed footer {
display: flex;
justify-content: space-between;
padding-top: 8px;
border-top: 1px solid #f1f5f9;
color: #64748b;
font-size: 12px;
}
.post-embed footer span span {
color: #e11d48;
}
This CSS Social Post Card is 58 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses linear gradients, CSS Grid and Flexbox. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
The colors in this snippet. Search and replace them to match your brand:
#e0f2fe#fff#0f172a#38bdf8#0369a1#64748b#f1f5f9#e11d48<style> tag..post-embed class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.class to className in the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.