17 / 28
All 28 in 28 Tailwind CSS Close Buttons
- 01Tailwind Modal Close Button (Top-Right Corner X)
- 02Accessible Tailwind Close Button with Focus Ring (WCAG)
- 03iOS-Style Tailwind Tab Close Button
- 04Tailwind Floating Chat Widget Close Button
- 05Tailwind Cookie Consent Banner Dismiss Button
- 06Tailwind Mobile Ad Banner Close Button (48px Tap Target)
- 07Neumorphic Tailwind Close Button (Soft UI)
- 08Tailwind Hamburger to X Menu Button Animation
- 09Tailwind Video Player Overlay Close Button
- 10Tailwind Drawer Close Button with Native Dialog
- 11Origami Fold Tailwind Close Button
- 12Lock Tumbler Tailwind Close Button (@property)
- 13Rotate on Hover Tailwind Close Button
- 14Magnetic Cursor Tailwind Close Button
- 15Liquid Goo Tailwind Close Button (SVG Filter)
- 16Glitch Effect Tailwind Close Button
- 17Trash Compactor Tailwind Close Button
- 18Material Ripple Tailwind Close Button
- 19Particle Burst Tailwind Close Button
- 20Spring Snap Tailwind Close Button
- 21Neon Glow Tailwind Close Button
- 22Corner Ribbon Tailwind Close Button
- 233D Fold Away Tailwind Close Button
- 24Hold to Confirm Tailwind Close Button
- 25Tailwind Toast Notification Dismiss Button
- 26Tailwind Lightbox Image Close Button
- 27Brutalist Tailwind Close Button
- 28Galaxy Vortex Tailwind Close Button
Trash Compactor Tailwind Close Button
A little machine: on hover two steel plates slam inward with group-hover:translate-y-[15px] while the × is crushed flat by scale-y-22 and bows out with scale-x-125. One anticipation curve, declared once in @theme as --ease-tcb17-crush, drives every part, so the plates and the glyph move as a single mechanism.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="tcb-17 w-full min-h-svh grid place-items-center bg-[linear-gradient(180deg,var(--color-tcb17-bg),var(--color-tcb17-bg2))] px-6 py-12 font-tcb17-sans" aria-label="Trash compactor close button demo">
<div class="grid w-full justify-items-center gap-7">
<button type="button" aria-label="Close" class="group relative grid size-19 cursor-pointer place-items-center overflow-hidden rounded-[14px] border border-tcb17-edge/60 bg-linear-to-b from-tcb17-h1 to-tcb17-h2 shadow-[0_16px_36px_-18px_rgb(0_0_0/0.85),inset_0_1px_0_var(--color-tcb17-hl)] focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-tcb17-ring active:scale-95">
<span aria-hidden="true" class="absolute inset-x-2.5 top-2 h-2 rounded-[3px] bg-linear-to-b from-tcb17-steel to-tcb17-steel2 shadow-[0_2px_4px_rgb(0_0_0/0.5)] transition-[translate] duration-340 ease-tcb17-crush group-hover:translate-y-[15px] group-focus-visible:translate-y-[15px] motion-reduce:transition-none"></span>
<span aria-hidden="true" class="relative size-6 transition-[scale] duration-340 ease-tcb17-crush before:absolute before:top-1/2 before:left-1/2 before:h-[3px] before:w-6 before:-translate-1/2 before:rotate-45 before:rounded-[2px] before:bg-tcb17-x after:absolute after:top-1/2 after:left-1/2 after:h-[3px] after:w-6 after:-translate-1/2 after:-rotate-45 after:rounded-[2px] after:bg-tcb17-x group-hover:scale-x-125 group-hover:scale-y-22 group-focus-visible:scale-x-125 group-focus-visible:scale-y-22 motion-reduce:transition-none"></span>
<span aria-hidden="true" class="absolute inset-x-2.5 bottom-2 h-2 rounded-[3px] bg-linear-to-b from-tcb17-steel to-tcb17-steel2 shadow-[0_2px_4px_rgb(0_0_0/0.5)] transition-[translate] duration-340 ease-tcb17-crush group-hover:-translate-y-[15px] group-focus-visible:-translate-y-[15px] motion-reduce:transition-none"></span>
</button>
<p aria-hidden="true" class="rounded-full px-3.5 py-2 font-tcb17-mono text-[11.5px] text-tcb17-mut ring-1 ring-white/12">ease-tcb17-crush · group-hover:scale-y-22 · translate-y-[15px]</p>
</div>
</section><section class="tcb-17 w-full min-h-svh grid place-items-center bg-[linear-gradient(180deg,var(--color-tcb17-bg),var(--color-tcb17-bg2))] px-6 py-12 font-tcb17-sans" aria-label="Trash compactor close button demo">
<div class="grid w-full justify-items-center gap-7">
<button type="button" aria-label="Close" class="group relative grid size-19 cursor-pointer place-items-center overflow-hidden rounded-[14px] border border-tcb17-edge/60 bg-linear-to-b from-tcb17-h1 to-tcb17-h2 shadow-[0_16px_36px_-18px_rgb(0_0_0/0.85),inset_0_1px_0_var(--color-tcb17-hl)] focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-tcb17-ring active:scale-95">
<span aria-hidden="true" class="absolute inset-x-2.5 top-2 h-2 rounded-[3px] bg-linear-to-b from-tcb17-steel to-tcb17-steel2 shadow-[0_2px_4px_rgb(0_0_0/0.5)] transition-[translate] duration-340 ease-tcb17-crush group-hover:translate-y-[15px] group-focus-visible:translate-y-[15px] motion-reduce:transition-none"></span>
<span aria-hidden="true" class="relative size-6 transition-[scale] duration-340 ease-tcb17-crush before:absolute before:top-1/2 before:left-1/2 before:h-[3px] before:w-6 before:-translate-1/2 before:rotate-45 before:rounded-[2px] before:bg-tcb17-x after:absolute after:top-1/2 after:left-1/2 after:h-[3px] after:w-6 after:-translate-1/2 after:-rotate-45 after:rounded-[2px] after:bg-tcb17-x group-hover:scale-x-125 group-hover:scale-y-22 group-focus-visible:scale-x-125 group-focus-visible:scale-y-22 motion-reduce:transition-none"></span>
<span aria-hidden="true" class="absolute inset-x-2.5 bottom-2 h-2 rounded-[3px] bg-linear-to-b from-tcb17-steel to-tcb17-steel2 shadow-[0_2px_4px_rgb(0_0_0/0.5)] transition-[translate] duration-340 ease-tcb17-crush group-hover:-translate-y-[15px] group-focus-visible:-translate-y-[15px] motion-reduce:transition-none"></span>
</button>
<p aria-hidden="true" class="rounded-full px-3.5 py-2 font-tcb17-mono text-[11.5px] text-tcb17-mut ring-1 ring-white/12">ease-tcb17-crush · group-hover:scale-y-22 · translate-y-[15px]</p>
</div>
</section>@import "tailwindcss";
@theme {
--color-tcb17-bg: #2d3139;
--color-tcb17-bg: oklch(0.32 0.02 255);
--color-tcb17-bg2: #1c1f25;
--color-tcb17-bg2: oklch(0.22 0.015 250);
--color-tcb17-h1: #4a4f59;
--color-tcb17-h1: oklch(0.4 0.02 250);
--color-tcb17-h2: #33373f;
--color-tcb17-h2: oklch(0.3 0.02 250);
--color-tcb17-hl: #6b717c80;
--color-tcb17-hl: oklch(0.55 0.02 250 / 0.5);
--color-tcb17-edge: #666b75;
--color-tcb17-edge: oklch(0.5 0.02 250);
--color-tcb17-steel: #b4b9c2;
--color-tcb17-steel: oklch(0.75 0.02 250);
--color-tcb17-steel2: #797e88;
--color-tcb17-steel2: oklch(0.55 0.02 250);
--color-tcb17-x: #e5e8ec;
--color-tcb17-x: oklch(0.92 0.01 250);
--color-tcb17-ring: #a7c3ec;
--color-tcb17-ring: oklch(0.8 0.1 250);
--color-tcb17-mut: #b3b8c2;
--color-tcb17-mut: oklch(0.77 0.02 250);
--font-tcb17-sans: 'Geist', system-ui, sans-serif;
--font-tcb17-mono: 'Geist Mono', ui-monospace, monospace;
--ease-tcb17-crush: cubic-bezier(0.6, -.28, 0.55, 1.32);
}
/* Root rule: the full-bleed contract, stated in CSS as well as in the markup's utilities, so the
stage is sized before the browser build compiles. */
.tcb-17 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-tcb17-bg: #2d3139;
--color-tcb17-bg: oklch(0.32 0.02 255);
--color-tcb17-bg2: #1c1f25;
--color-tcb17-bg2: oklch(0.22 0.015 250);
--color-tcb17-h1: #4a4f59;
--color-tcb17-h1: oklch(0.4 0.02 250);
--color-tcb17-h2: #33373f;
--color-tcb17-h2: oklch(0.3 0.02 250);
--color-tcb17-hl: #6b717c80;
--color-tcb17-hl: oklch(0.55 0.02 250 / 0.5);
--color-tcb17-edge: #666b75;
--color-tcb17-edge: oklch(0.5 0.02 250);
--color-tcb17-steel: #b4b9c2;
--color-tcb17-steel: oklch(0.75 0.02 250);
--color-tcb17-steel2: #797e88;
--color-tcb17-steel2: oklch(0.55 0.02 250);
--color-tcb17-x: #e5e8ec;
--color-tcb17-x: oklch(0.92 0.01 250);
--color-tcb17-ring: #a7c3ec;
--color-tcb17-ring: oklch(0.8 0.1 250);
--color-tcb17-mut: #b3b8c2;
--color-tcb17-mut: oklch(0.77 0.02 250);
--font-tcb17-sans: 'Geist', system-ui, sans-serif;
--font-tcb17-mono: 'Geist Mono', ui-monospace, monospace;
--ease-tcb17-crush: cubic-bezier(0.6, -.28, 0.55, 1.32);
}
/* Root rule: the full-bleed contract, stated in CSS as well as in the markup's utilities, so the
stage is sized before the browser build compiles. */
.tcb-17 {
width: 100%;
min-height: 100svh;
}Setup — do this once per project
Skip this if your project already runs Tailwind v4.
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>Compiles in the browser — perfect for a CodePen or a quick test, not for production.
npm install tailwindcss @tailwindcss/vite
npm install tailwindcss @tailwindcss/vite// vite.config.js ("type": "module" in package.json)
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
})// vite.config.js ("type": "module" in package.json)
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
})Any v4 setup works — Vite, PostCSS or the CLI. Nothing in this demo is bundler-specific.
@import "tailwindcss";
@theme {
--color-tcb17-bg: #2d3139;
--color-tcb17-bg: oklch(0.32 0.02 255);
--color-tcb17-bg2: #1c1f25;
--color-tcb17-bg2: oklch(0.22 0.015 250);
--color-tcb17-h1: #4a4f59;
--color-tcb17-h1: oklch(0.4 0.02 250);
--color-tcb17-h2: #33373f;
--color-tcb17-h2: oklch(0.3 0.02 250);
--color-tcb17-hl: #6b717c80;
--color-tcb17-hl: oklch(0.55 0.02 250 / 0.5);
--color-tcb17-edge: #666b75;
--color-tcb17-edge: oklch(0.5 0.02 250);
--color-tcb17-steel: #b4b9c2;
--color-tcb17-steel: oklch(0.75 0.02 250);
--color-tcb17-steel2: #797e88;
--color-tcb17-steel2: oklch(0.55 0.02 250);
--color-tcb17-x: #e5e8ec;
--color-tcb17-x: oklch(0.92 0.01 250);
--color-tcb17-ring: #a7c3ec;
--color-tcb17-ring: oklch(0.8 0.1 250);
--color-tcb17-mut: #b3b8c2;
--color-tcb17-mut: oklch(0.77 0.02 250);
--font-tcb17-sans: 'Geist', system-ui, sans-serif;
--font-tcb17-mono: 'Geist Mono', ui-monospace, monospace;
--ease-tcb17-crush: cubic-bezier(0.6, -.28, 0.55, 1.32);
}
/* Root rule: the full-bleed contract, stated in CSS as well as in the markup's utilities, so the
stage is sized before the browser build compiles. */
.tcb-17 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-tcb17-bg: #2d3139;
--color-tcb17-bg: oklch(0.32 0.02 255);
--color-tcb17-bg2: #1c1f25;
--color-tcb17-bg2: oklch(0.22 0.015 250);
--color-tcb17-h1: #4a4f59;
--color-tcb17-h1: oklch(0.4 0.02 250);
--color-tcb17-h2: #33373f;
--color-tcb17-h2: oklch(0.3 0.02 250);
--color-tcb17-hl: #6b717c80;
--color-tcb17-hl: oklch(0.55 0.02 250 / 0.5);
--color-tcb17-edge: #666b75;
--color-tcb17-edge: oklch(0.5 0.02 250);
--color-tcb17-steel: #b4b9c2;
--color-tcb17-steel: oklch(0.75 0.02 250);
--color-tcb17-steel2: #797e88;
--color-tcb17-steel2: oklch(0.55 0.02 250);
--color-tcb17-x: #e5e8ec;
--color-tcb17-x: oklch(0.92 0.01 250);
--color-tcb17-ring: #a7c3ec;
--color-tcb17-ring: oklch(0.8 0.1 250);
--color-tcb17-mut: #b3b8c2;
--color-tcb17-mut: oklch(0.77 0.02 250);
--font-tcb17-sans: 'Geist', system-ui, sans-serif;
--font-tcb17-mono: 'Geist Mono', ui-monospace, monospace;
--ease-tcb17-crush: cubic-bezier(0.6, -.28, 0.55, 1.32);
}
/* Root rule: the full-bleed contract, stated in CSS as well as in the markup's utilities, so the
stage is sized before the browser build compiles. */
.tcb-17 {
width: 100%;
min-height: 100svh;
}<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400..800&family=Geist+Mono:wght@400..600&display=swap">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400..800&family=Geist+Mono:wght@400..600&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
- The
--easecustom property became an@themeentry,--ease-tcb17-crush, which v4 turns into theease-tcb17-crushutility. --crush:.22becamescale-y-22; the hover rules no longer restate the bars' centring transforms.- UI upgrade from the CSS original: keyboard focus runs the compactor too, and the stage caption rose to 7:1 on the dark steel background.
Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Trash Compactor Tailwind Close Button
Source: https://codefronts.com/components/tailwind-css-close-buttons/trash-compactor/
A little machine: on hover two steel plates slam inward with group-hover:translate-y-[15px] while the × is crushed flat by scale-y-22 and bows out with scale-x-125. One anticipation curve, declared once in @theme as --ease-tcb17-crush, drives every part, so the plates and the glyph move as a single mechanism.
## HTML
```html
<section class="tcb-17 w-full min-h-svh grid place-items-center bg-[linear-gradient(180deg,var(--color-tcb17-bg),var(--color-tcb17-bg2))] px-6 py-12 font-tcb17-sans" aria-label="Trash compactor close button demo">
<div class="grid w-full justify-items-center gap-7">
<button type="button" aria-label="Close" class="group relative grid size-19 cursor-pointer place-items-center overflow-hidden rounded-[14px] border border-tcb17-edge/60 bg-linear-to-b from-tcb17-h1 to-tcb17-h2 shadow-[0_16px_36px_-18px_rgb(0_0_0/0.85),inset_0_1px_0_var(--color-tcb17-hl)] focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-tcb17-ring active:scale-95">
<span aria-hidden="true" class="absolute inset-x-2.5 top-2 h-2 rounded-[3px] bg-linear-to-b from-tcb17-steel to-tcb17-steel2 shadow-[0_2px_4px_rgb(0_0_0/0.5)] transition-[translate] duration-340 ease-tcb17-crush group-hover:translate-y-[15px] group-focus-visible:translate-y-[15px] motion-reduce:transition-none"></span>
<span aria-hidden="true" class="relative size-6 transition-[scale] duration-340 ease-tcb17-crush before:absolute before:top-1/2 before:left-1/2 before:h-[3px] before:w-6 before:-translate-1/2 before:rotate-45 before:rounded-[2px] before:bg-tcb17-x after:absolute after:top-1/2 after:left-1/2 after:h-[3px] after:w-6 after:-translate-1/2 after:-rotate-45 after:rounded-[2px] after:bg-tcb17-x group-hover:scale-x-125 group-hover:scale-y-22 group-focus-visible:scale-x-125 group-focus-visible:scale-y-22 motion-reduce:transition-none"></span>
<span aria-hidden="true" class="absolute inset-x-2.5 bottom-2 h-2 rounded-[3px] bg-linear-to-b from-tcb17-steel to-tcb17-steel2 shadow-[0_2px_4px_rgb(0_0_0/0.5)] transition-[translate] duration-340 ease-tcb17-crush group-hover:-translate-y-[15px] group-focus-visible:-translate-y-[15px] motion-reduce:transition-none"></span>
</button>
<p aria-hidden="true" class="rounded-full px-3.5 py-2 font-tcb17-mono text-[11.5px] text-tcb17-mut ring-1 ring-white/12">ease-tcb17-crush · group-hover:scale-y-22 · translate-y-[15px]</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tcb17-bg: #2d3139;
--color-tcb17-bg: oklch(0.32 0.02 255);
--color-tcb17-bg2: #1c1f25;
--color-tcb17-bg2: oklch(0.22 0.015 250);
--color-tcb17-h1: #4a4f59;
--color-tcb17-h1: oklch(0.4 0.02 250);
--color-tcb17-h2: #33373f;
--color-tcb17-h2: oklch(0.3 0.02 250);
--color-tcb17-hl: #6b717c80;
--color-tcb17-hl: oklch(0.55 0.02 250 / 0.5);
--color-tcb17-edge: #666b75;
--color-tcb17-edge: oklch(0.5 0.02 250);
--color-tcb17-steel: #b4b9c2;
--color-tcb17-steel: oklch(0.75 0.02 250);
--color-tcb17-steel2: #797e88;
--color-tcb17-steel2: oklch(0.55 0.02 250);
--color-tcb17-x: #e5e8ec;
--color-tcb17-x: oklch(0.92 0.01 250);
--color-tcb17-ring: #a7c3ec;
--color-tcb17-ring: oklch(0.8 0.1 250);
--color-tcb17-mut: #b3b8c2;
--color-tcb17-mut: oklch(0.77 0.02 250);
--font-tcb17-sans: 'Geist', system-ui, sans-serif;
--font-tcb17-mono: 'Geist Mono', ui-monospace, monospace;
--ease-tcb17-crush: cubic-bezier(0.6, -.28, 0.55, 1.32);
}
/* Root rule: the full-bleed contract, stated in CSS as well as in the markup's utilities, so the
stage is sized before the browser build compiles. */
.tcb-17 {
width: 100%;
min-height: 100svh;
}
```Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Trash Compactor Tailwind Close Button
Source: https://codefronts.com/components/tailwind-css-close-buttons/trash-compactor/
A little machine: on hover two steel plates slam inward with group-hover:translate-y-[15px] while the × is crushed flat by scale-y-22 and bows out with scale-x-125. One anticipation curve, declared once in @theme as --ease-tcb17-crush, drives every part, so the plates and the glyph move as a single mechanism.
## HTML
```html
<section class="tcb-17 w-full min-h-svh grid place-items-center bg-[linear-gradient(180deg,var(--color-tcb17-bg),var(--color-tcb17-bg2))] px-6 py-12 font-tcb17-sans" aria-label="Trash compactor close button demo">
<div class="grid w-full justify-items-center gap-7">
<button type="button" aria-label="Close" class="group relative grid size-19 cursor-pointer place-items-center overflow-hidden rounded-[14px] border border-tcb17-edge/60 bg-linear-to-b from-tcb17-h1 to-tcb17-h2 shadow-[0_16px_36px_-18px_rgb(0_0_0/0.85),inset_0_1px_0_var(--color-tcb17-hl)] focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-tcb17-ring active:scale-95">
<span aria-hidden="true" class="absolute inset-x-2.5 top-2 h-2 rounded-[3px] bg-linear-to-b from-tcb17-steel to-tcb17-steel2 shadow-[0_2px_4px_rgb(0_0_0/0.5)] transition-[translate] duration-340 ease-tcb17-crush group-hover:translate-y-[15px] group-focus-visible:translate-y-[15px] motion-reduce:transition-none"></span>
<span aria-hidden="true" class="relative size-6 transition-[scale] duration-340 ease-tcb17-crush before:absolute before:top-1/2 before:left-1/2 before:h-[3px] before:w-6 before:-translate-1/2 before:rotate-45 before:rounded-[2px] before:bg-tcb17-x after:absolute after:top-1/2 after:left-1/2 after:h-[3px] after:w-6 after:-translate-1/2 after:-rotate-45 after:rounded-[2px] after:bg-tcb17-x group-hover:scale-x-125 group-hover:scale-y-22 group-focus-visible:scale-x-125 group-focus-visible:scale-y-22 motion-reduce:transition-none"></span>
<span aria-hidden="true" class="absolute inset-x-2.5 bottom-2 h-2 rounded-[3px] bg-linear-to-b from-tcb17-steel to-tcb17-steel2 shadow-[0_2px_4px_rgb(0_0_0/0.5)] transition-[translate] duration-340 ease-tcb17-crush group-hover:-translate-y-[15px] group-focus-visible:-translate-y-[15px] motion-reduce:transition-none"></span>
</button>
<p aria-hidden="true" class="rounded-full px-3.5 py-2 font-tcb17-mono text-[11.5px] text-tcb17-mut ring-1 ring-white/12">ease-tcb17-crush · group-hover:scale-y-22 · translate-y-[15px]</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tcb17-bg: #2d3139;
--color-tcb17-bg: oklch(0.32 0.02 255);
--color-tcb17-bg2: #1c1f25;
--color-tcb17-bg2: oklch(0.22 0.015 250);
--color-tcb17-h1: #4a4f59;
--color-tcb17-h1: oklch(0.4 0.02 250);
--color-tcb17-h2: #33373f;
--color-tcb17-h2: oklch(0.3 0.02 250);
--color-tcb17-hl: #6b717c80;
--color-tcb17-hl: oklch(0.55 0.02 250 / 0.5);
--color-tcb17-edge: #666b75;
--color-tcb17-edge: oklch(0.5 0.02 250);
--color-tcb17-steel: #b4b9c2;
--color-tcb17-steel: oklch(0.75 0.02 250);
--color-tcb17-steel2: #797e88;
--color-tcb17-steel2: oklch(0.55 0.02 250);
--color-tcb17-x: #e5e8ec;
--color-tcb17-x: oklch(0.92 0.01 250);
--color-tcb17-ring: #a7c3ec;
--color-tcb17-ring: oklch(0.8 0.1 250);
--color-tcb17-mut: #b3b8c2;
--color-tcb17-mut: oklch(0.77 0.02 250);
--font-tcb17-sans: 'Geist', system-ui, sans-serif;
--font-tcb17-mono: 'Geist Mono', ui-monospace, monospace;
--ease-tcb17-crush: cubic-bezier(0.6, -.28, 0.55, 1.32);
}
/* Root rule: the full-bleed contract, stated in CSS as well as in the markup's utilities, so the
stage is sized before the browser build compiles. */
.tcb-17 {
width: 100%;
min-height: 100svh;
}
```How this works
Name the curve, reuse the curve. The CSS original kept a --ease variable; in v4 an --ease-* theme entry is a utility:
@theme { --ease-tcb17-crush: cubic-bezier(.6,-.28,.55,1.32); }
<span class="… duration-340 ease-tcb17-crush group-hover:translate-y-[15px]">The negative first handle winds the plates back before they strike; the >1 second handle lets them bounce off the glyph.
Make it yours
- Harder crush:
scale-y-10. - Horizontal compactor: rotate the housing
rotate-90and counter-rotate the glyph. - Colour-coded danger: tint plates with a red token on destructive dialogs.
Gotchas — read before shipping
scale-y-22means 22% — v4 accepts any integer percentage without brackets.- Scaling a pseudo-element's parent scales the bars' thickness too; that squash is the effect.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
The floor is Tailwind v4's generated sheet.