09 / 22
All 22 in 22 Tailwind CSS Image Gallery
- 01Tailwind Hexagon Honeycomb Image Gallery with clip-path
- 02Tailwind Justified Image Gallery with Aspect-Ratio Flex Rows
- 03Tailwind Expanding Panel Image Gallery with Flex-Grow Transitions
- 04Tailwind :has() Hover Spotlight Image Grid
- 05Tailwind Radial Orbit Image Gallery with Counter-Rotating Thumbnails
- 06Tailwind Interactive Pointer Trail Image Gallery
- 07Tailwind Masonry Image Gallery with CSS Columns (No JavaScript)
- 08Tailwind Metro Tile Grid Gallery with Dense Auto-Flow
- 09Tailwind Editorial Magazine Grid Gallery with Blend-Mode Headline
- 10Tailwind Pure CSS Lightbox Gallery with :target (No JavaScript)
- 11Tailwind Filmstrip Carousel Gallery with CSS Scroll-Snap
- 12Tailwind Accordion Image Gallery with Flex-Grow on Hover & Focus
- 13Tailwind Mosaic Grid Gallery with Contained Zoom on Hover
- 14Tailwind Glassmorphism Image Cards with backdrop-blur
- 15Tailwind Diagonal Slice Reveal Gallery with clip-path Halves
- 16Tailwind 3D Tilt Parallax Image Cards with Pointer-Driven Variables
- 17Tailwind 3D Cube Image Viewer with Radio-Driven Rotation
- 18Tailwind 3D Perspective Depth Stack Gallery That Fans on Focus
- 19Tailwind Infinite Scrolling Image Marquee with Seamless Loop
- 20Tailwind Ken Burns Slideshow Gallery with Staggered Cross-Fade
- 21Tailwind Polaroid Photo Stack Gallery with Rotate-on-Hover
- 22Tailwind Scattered Photo Collage with :target Spotlight
Tailwind Editorial Magazine Grid Gallery with Blend-Mode Headline
A premium editorial spread: a tall hero with the headline set directly over it in mix-blend-mode: difference, flanked by an asymmetric grid of supporting shots. The port keeps the print-inspired type treatment and adds the scrim the blend mode needs to be safe.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="tgl-09 w-full min-h-svh grid place-items-center bg-tgl09-bg font-tgl09-sans px-5 py-11" aria-label="Magazine layout gallery">
<div class="w-[min(940px,100%)] grid grid-cols-2 gap-3.5 max-[640px]:grid-cols-1">
<figure class="relative m-0 rounded-md overflow-hidden [grid-area:1/1/3/2] max-[640px]:[grid-area:auto]">
<img src="https://images.unsplash.com/photo-1481277542470-605612bd2d61?q=80&w=900&h=700&auto=format&fit=crop" alt="Winding coastal road at sunset" loading="lazy" decoding="async" class="block w-full h-full object-cover [aspect-ratio:9/11]">
<span aria-hidden="true" class="absolute inset-x-0 bottom-0 h-1/3 bg-[linear-gradient(0deg,rgba(0,0,0,0.45),transparent)]"></span>
<figcaption class="absolute inset-x-0 bottom-0 p-6 mix-blend-difference text-white">
<span class="block font-tgl09-mono text-xs tracking-[0.2em] uppercase opacity-90">Issue 24 · Travel</span>
<h3 class="mt-2 font-tgl09-serif text-[40px] leading-[1.02] font-bold tracking-[-0.01em] text-balance max-[640px]:text-[32px]">The Long Way North</h3>
</figcaption>
</figure>
<figure class="group relative m-0 rounded-md overflow-hidden bg-tgl09-well">
<img src="https://images.unsplash.com/photo-1531403009284-440f080d1e12?q=80&w=500&h=500&auto=format&fit=crop" alt="Fishing harbour at first light" loading="lazy" decoding="async" class="block w-full h-full object-cover aspect-square transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Harbour mornings</figcaption>
</figure>
<figure class="group relative m-0 rounded-md overflow-hidden bg-tgl09-well">
<img src="https://images.unsplash.com/photo-1526374965328-7f61d4dc18c5?q=80&w=500&h=500&auto=format&fit=crop" alt="Timber cabin among pines" loading="lazy" decoding="async" class="block w-full h-full object-cover aspect-square transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Off the map</figcaption>
</figure>
<figure class="group relative m-0 col-span-2 rounded-md overflow-hidden bg-tgl09-well max-[640px]:col-span-1">
<img src="https://images.unsplash.com/photo-1611432579699-484f7990b127?q=80&w=900&h=450&auto=format&fit=crop" alt="Empty mountain highway" loading="lazy" decoding="async" class="block w-full h-full object-cover [aspect-ratio:2/1] transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Nothing but road ahead</figcaption>
</figure>
</div>
</section><section class="tgl-09 w-full min-h-svh grid place-items-center bg-tgl09-bg font-tgl09-sans px-5 py-11" aria-label="Magazine layout gallery">
<div class="w-[min(940px,100%)] grid grid-cols-2 gap-3.5 max-[640px]:grid-cols-1">
<figure class="relative m-0 rounded-md overflow-hidden [grid-area:1/1/3/2] max-[640px]:[grid-area:auto]">
<img src="https://images.unsplash.com/photo-1481277542470-605612bd2d61?q=80&w=900&h=700&auto=format&fit=crop" alt="Winding coastal road at sunset" loading="lazy" decoding="async" class="block w-full h-full object-cover [aspect-ratio:9/11]">
<span aria-hidden="true" class="absolute inset-x-0 bottom-0 h-1/3 bg-[linear-gradient(0deg,rgba(0,0,0,0.45),transparent)]"></span>
<figcaption class="absolute inset-x-0 bottom-0 p-6 mix-blend-difference text-white">
<span class="block font-tgl09-mono text-xs tracking-[0.2em] uppercase opacity-90">Issue 24 · Travel</span>
<h3 class="mt-2 font-tgl09-serif text-[40px] leading-[1.02] font-bold tracking-[-0.01em] text-balance max-[640px]:text-[32px]">The Long Way North</h3>
</figcaption>
</figure>
<figure class="group relative m-0 rounded-md overflow-hidden bg-tgl09-well">
<img src="https://images.unsplash.com/photo-1531403009284-440f080d1e12?q=80&w=500&h=500&auto=format&fit=crop" alt="Fishing harbour at first light" loading="lazy" decoding="async" class="block w-full h-full object-cover aspect-square transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Harbour mornings</figcaption>
</figure>
<figure class="group relative m-0 rounded-md overflow-hidden bg-tgl09-well">
<img src="https://images.unsplash.com/photo-1526374965328-7f61d4dc18c5?q=80&w=500&h=500&auto=format&fit=crop" alt="Timber cabin among pines" loading="lazy" decoding="async" class="block w-full h-full object-cover aspect-square transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Off the map</figcaption>
</figure>
<figure class="group relative m-0 col-span-2 rounded-md overflow-hidden bg-tgl09-well max-[640px]:col-span-1">
<img src="https://images.unsplash.com/photo-1611432579699-484f7990b127?q=80&w=900&h=450&auto=format&fit=crop" alt="Empty mountain highway" loading="lazy" decoding="async" class="block w-full h-full object-cover [aspect-ratio:2/1] transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Nothing but road ahead</figcaption>
</figure>
</div>
</section>@import "tailwindcss";
@theme {
--color-tgl09-bg: #f7f5f0;
--color-tgl09-bg: oklch(0.97 0.008 85);
--color-tgl09-well: #e7e3da;
--color-tgl09-well: oklch(0.91 0.012 85);
--color-tgl09-acc: #1a1a1a;
--color-tgl09-acc: oklch(0.2 0 0);
--font-tgl09-sans: 'Space Grotesk', system-ui, sans-serif;
--font-tgl09-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
--font-tgl09-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
.tgl-09 {
width: 100%;
min-height: 100svh;
}
.tgl-09 ::selection {
background: var(--color-tgl09-acc);
color: #fff;
}@import "tailwindcss";
@theme {
--color-tgl09-bg: #f7f5f0;
--color-tgl09-bg: oklch(0.97 0.008 85);
--color-tgl09-well: #e7e3da;
--color-tgl09-well: oklch(0.91 0.012 85);
--color-tgl09-acc: #1a1a1a;
--color-tgl09-acc: oklch(0.2 0 0);
--font-tgl09-sans: 'Space Grotesk', system-ui, sans-serif;
--font-tgl09-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
--font-tgl09-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
.tgl-09 {
width: 100%;
min-height: 100svh;
}
.tgl-09 ::selection {
background: var(--color-tgl09-acc);
color: #fff;
}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-tgl09-bg: #f7f5f0;
--color-tgl09-bg: oklch(0.97 0.008 85);
--color-tgl09-well: #e7e3da;
--color-tgl09-well: oklch(0.91 0.012 85);
--color-tgl09-acc: #1a1a1a;
--color-tgl09-acc: oklch(0.2 0 0);
--font-tgl09-sans: 'Space Grotesk', system-ui, sans-serif;
--font-tgl09-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
--font-tgl09-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
.tgl-09 {
width: 100%;
min-height: 100svh;
}
.tgl-09 ::selection {
background: var(--color-tgl09-acc);
color: #fff;
}@import "tailwindcss";
@theme {
--color-tgl09-bg: #f7f5f0;
--color-tgl09-bg: oklch(0.97 0.008 85);
--color-tgl09-well: #e7e3da;
--color-tgl09-well: oklch(0.91 0.012 85);
--color-tgl09-acc: #1a1a1a;
--color-tgl09-acc: oklch(0.2 0 0);
--font-tgl09-sans: 'Space Grotesk', system-ui, sans-serif;
--font-tgl09-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
--font-tgl09-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
.tgl-09 {
width: 100%;
min-height: 100svh;
}
.tgl-09 ::selection {
background: var(--color-tgl09-acc);
color: #fff;
}<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=Space+Grotesk:wght@400;500;600;700&family=Playfair+Display:wght@700;900&family=JetBrains+Mono:wght@400;500&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=Space+Grotesk:wght@400;500;600;700&family=Playfair+Display:wght@700;900&family=JetBrains+Mono:wght@400;500&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
- Three font roles as three
@themeentries mintfont-tgl09-sans,-serifand-mono. In the CSS version the serif was repeated as a literal stack in four rules. [grid-area:1/1/3/2]beatsrow-span-2here because the spread is a designed composition, not a flow: the hero must be in that cell, not wherever auto-placement puts it.- UI change from the CSS original: a scrim was added beneath the blend-mode headline, and the display face is now Playfair Display rather than Georgia — the original's blend-only approach dropped below 4.5:1 wherever the photograph went mid-grey.
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: Tailwind Editorial Magazine Grid Gallery with Blend-Mode Headline
Source: https://codefronts.com/snippets/tailwind-css-image-gallery/tailwind-editorial-magazine-grid-gallery-blend-mode/
A premium editorial spread: a tall hero with the headline set directly over it in mix-blend-mode: difference, flanked by an asymmetric grid of supporting shots. The port keeps the print-inspired type treatment and adds the scrim the blend mode needs to be safe.
## HTML
```html
<section class="tgl-09 w-full min-h-svh grid place-items-center bg-tgl09-bg font-tgl09-sans px-5 py-11" aria-label="Magazine layout gallery">
<div class="w-[min(940px,100%)] grid grid-cols-2 gap-3.5 max-[640px]:grid-cols-1">
<figure class="relative m-0 rounded-md overflow-hidden [grid-area:1/1/3/2] max-[640px]:[grid-area:auto]">
<img src="https://images.unsplash.com/photo-1481277542470-605612bd2d61?q=80&w=900&h=700&auto=format&fit=crop" alt="Winding coastal road at sunset" loading="lazy" decoding="async" class="block w-full h-full object-cover [aspect-ratio:9/11]">
<span aria-hidden="true" class="absolute inset-x-0 bottom-0 h-1/3 bg-[linear-gradient(0deg,rgba(0,0,0,0.45),transparent)]"></span>
<figcaption class="absolute inset-x-0 bottom-0 p-6 mix-blend-difference text-white">
<span class="block font-tgl09-mono text-xs tracking-[0.2em] uppercase opacity-90">Issue 24 · Travel</span>
<h3 class="mt-2 font-tgl09-serif text-[40px] leading-[1.02] font-bold tracking-[-0.01em] text-balance max-[640px]:text-[32px]">The Long Way North</h3>
</figcaption>
</figure>
<figure class="group relative m-0 rounded-md overflow-hidden bg-tgl09-well">
<img src="https://images.unsplash.com/photo-1531403009284-440f080d1e12?q=80&w=500&h=500&auto=format&fit=crop" alt="Fishing harbour at first light" loading="lazy" decoding="async" class="block w-full h-full object-cover aspect-square transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Harbour mornings</figcaption>
</figure>
<figure class="group relative m-0 rounded-md overflow-hidden bg-tgl09-well">
<img src="https://images.unsplash.com/photo-1526374965328-7f61d4dc18c5?q=80&w=500&h=500&auto=format&fit=crop" alt="Timber cabin among pines" loading="lazy" decoding="async" class="block w-full h-full object-cover aspect-square transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Off the map</figcaption>
</figure>
<figure class="group relative m-0 col-span-2 rounded-md overflow-hidden bg-tgl09-well max-[640px]:col-span-1">
<img src="https://images.unsplash.com/photo-1611432579699-484f7990b127?q=80&w=900&h=450&auto=format&fit=crop" alt="Empty mountain highway" loading="lazy" decoding="async" class="block w-full h-full object-cover [aspect-ratio:2/1] transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Nothing but road ahead</figcaption>
</figure>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tgl09-bg: #f7f5f0;
--color-tgl09-bg: oklch(0.97 0.008 85);
--color-tgl09-well: #e7e3da;
--color-tgl09-well: oklch(0.91 0.012 85);
--color-tgl09-acc: #1a1a1a;
--color-tgl09-acc: oklch(0.2 0 0);
--font-tgl09-sans: 'Space Grotesk', system-ui, sans-serif;
--font-tgl09-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
--font-tgl09-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
.tgl-09 {
width: 100%;
min-height: 100svh;
}
.tgl-09 ::selection {
background: var(--color-tgl09-acc);
color: #fff;
}
```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: Tailwind Editorial Magazine Grid Gallery with Blend-Mode Headline
Source: https://codefronts.com/snippets/tailwind-css-image-gallery/tailwind-editorial-magazine-grid-gallery-blend-mode/
A premium editorial spread: a tall hero with the headline set directly over it in mix-blend-mode: difference, flanked by an asymmetric grid of supporting shots. The port keeps the print-inspired type treatment and adds the scrim the blend mode needs to be safe.
## HTML
```html
<section class="tgl-09 w-full min-h-svh grid place-items-center bg-tgl09-bg font-tgl09-sans px-5 py-11" aria-label="Magazine layout gallery">
<div class="w-[min(940px,100%)] grid grid-cols-2 gap-3.5 max-[640px]:grid-cols-1">
<figure class="relative m-0 rounded-md overflow-hidden [grid-area:1/1/3/2] max-[640px]:[grid-area:auto]">
<img src="https://images.unsplash.com/photo-1481277542470-605612bd2d61?q=80&w=900&h=700&auto=format&fit=crop" alt="Winding coastal road at sunset" loading="lazy" decoding="async" class="block w-full h-full object-cover [aspect-ratio:9/11]">
<span aria-hidden="true" class="absolute inset-x-0 bottom-0 h-1/3 bg-[linear-gradient(0deg,rgba(0,0,0,0.45),transparent)]"></span>
<figcaption class="absolute inset-x-0 bottom-0 p-6 mix-blend-difference text-white">
<span class="block font-tgl09-mono text-xs tracking-[0.2em] uppercase opacity-90">Issue 24 · Travel</span>
<h3 class="mt-2 font-tgl09-serif text-[40px] leading-[1.02] font-bold tracking-[-0.01em] text-balance max-[640px]:text-[32px]">The Long Way North</h3>
</figcaption>
</figure>
<figure class="group relative m-0 rounded-md overflow-hidden bg-tgl09-well">
<img src="https://images.unsplash.com/photo-1531403009284-440f080d1e12?q=80&w=500&h=500&auto=format&fit=crop" alt="Fishing harbour at first light" loading="lazy" decoding="async" class="block w-full h-full object-cover aspect-square transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Harbour mornings</figcaption>
</figure>
<figure class="group relative m-0 rounded-md overflow-hidden bg-tgl09-well">
<img src="https://images.unsplash.com/photo-1526374965328-7f61d4dc18c5?q=80&w=500&h=500&auto=format&fit=crop" alt="Timber cabin among pines" loading="lazy" decoding="async" class="block w-full h-full object-cover aspect-square transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Off the map</figcaption>
</figure>
<figure class="group relative m-0 col-span-2 rounded-md overflow-hidden bg-tgl09-well max-[640px]:col-span-1">
<img src="https://images.unsplash.com/photo-1611432579699-484f7990b127?q=80&w=900&h=450&auto=format&fit=crop" alt="Empty mountain highway" loading="lazy" decoding="async" class="block w-full h-full object-cover [aspect-ratio:2/1] transition-transform duration-500 ease-[cubic-bezier(0.2,0.7,0.2,1)] group-hover:scale-105 motion-reduce:transition-none">
<figcaption class="absolute inset-x-0 bottom-0 px-3.5 py-2.5 w-full text-white font-tgl09-serif italic text-[15px] bg-[linear-gradient(0deg,rgba(0,0,0,0.65),transparent)]">Nothing but road ahead</figcaption>
</figure>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tgl09-bg: #f7f5f0;
--color-tgl09-bg: oklch(0.97 0.008 85);
--color-tgl09-well: #e7e3da;
--color-tgl09-well: oklch(0.91 0.012 85);
--color-tgl09-acc: #1a1a1a;
--color-tgl09-acc: oklch(0.2 0 0);
--font-tgl09-sans: 'Space Grotesk', system-ui, sans-serif;
--font-tgl09-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
--font-tgl09-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
.tgl-09 {
width: 100%;
min-height: 100svh;
}
.tgl-09 ::selection {
background: var(--color-tgl09-acc);
color: #fff;
}
```How this works
The headline inverts against the photograph. mix-blend-difference subtracts the backdrop from the type, so white text stays legible over light and dark areas alike — the trick print-inspired layouts have used for decades, and a real utility in Tailwind.
Placement is explicit. The hero claims rows 1–2 of column 1 via [grid-area:1/1/3/2]; the supporting cells flow into what is left, and the wide cell spans both columns at the foot of the spread.
Blend is not a contrast strategy on its own. A soft scrim sits under the overlay so the kicker and title hold 4.5:1 even where the photograph goes mid-grey — the one place a blend mode reliably fails.
Make it yours
- Rebalance the spread by editing the hero's
[grid-area:...]; everything else reflows around it. - Try
mix-blend-exclusionormix-blend-overlayfor a softer inversion. - Swap
--font-tgl09-seriffor your editorial face — it is one token, used twice.
Gotchas — read before shipping
- Blend-mode legibility depends on the actual photograph. Test with the real image, never a placeholder, and keep the scrim.
mix-blend-*creates a stacking context; anything that must sit above the overlay needs its ownz-*.- Give the hero a fixed
[aspect-ratio:9/11]so the overlaid headline lands in a predictable place at every width.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
Grid and mix-blend-mode are universal; the floor is Tailwind v4's generated sheet.