30 Tailwind CSS Grid Layouts
21 / 30

All 30 in 30 Tailwind CSS Grid Layouts

  1. 01Tailwind Full-Bleed Article Layout for Long-Form Editorial
  2. 02Tailwind Docs Layout with Sticky Table of Contents
  3. 03Tailwind Photo Gallery Grid with auto-fill and Real Images
  4. 04Tailwind Holy Grail Page Layout for a News Site
  5. 05Tailwind Data Table with Subgrid Rows and Status Pills
  6. 06Tailwind Overlapping Card Hero for a Case Study
  7. 07Tailwind Help Center Layout with Fixed Sidebars
  8. 08Tailwind 12 Column Grid System for Marketing Pages
  9. 09Tailwind Bento Grid for a Product Feature Section
  10. 10Tailwind Magazine Spread Layout with Overlapping Headline
  11. 11Tailwind Responsive Card Grid for an Integrations Directory
  12. 12Tailwind CMS Category Grid that Compacts Itself with has()
  13. 13Tailwind Masonry Layout for a Saved Ideas Board
  14. 14Tailwind Hexagon Team Grid with clip-path Avatars
  15. 15Tailwind Subgrid Cards with Perfectly Aligned Buttons
  16. 16Tailwind Analytics Dashboard Layout with Grid App Shell
  17. 17Tailwind Pricing Table with Subgrid and a Featured Plan
  18. 18Tailwind Kanban Board with Scroll Snap Columns
  19. 19Tailwind Video Thumbnail Grid with Zero Layout Shift
  20. 20Tailwind Container Query Card for Reusable Article Teasers
  21. 21Tailwind Diagonal Section Band with skewY Counter-Skew
  22. 22Tailwind Asymmetric Poster Hero with Layered Grid Regions
  23. 23Tailwind Mosaic Photo Wall with a Designed Span Sequence
  24. 24Tailwind Dense Grid Packing for a Mixed-Size Asset Library
  25. 25Tailwind Onboarding Stepper with CSS Counters
  26. 26Tailwind macOS Window Layout with Vibrancy Sidebar
  27. 27Tailwind Scroll Snap Carousel with Peeking Slides
  28. 28Tailwind Status Map UI with Grid Coordinate Pins
  29. 29Tailwind Logo Wall with 1px Gap Hairline Dividers
  30. 30Tailwind Periodic Table Layout with Grid Coordinates
Pure TailwindMIT licensed

Tailwind Diagonal Section Band with skewY Counter-Skew

The angled results band every agency site ships: the section skews, its children counter-skew, and the stats grid inside never knows it is tilted. No SVG dividers, no clip-path seams that misalign at odd widths.

Live Demo
Plain CSSTailwind v4
Try it

Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time

Untitled UI React · Affiliate link

Get Untitled UI Pro

The code

<section class="tgx-21 w-full min-h-svh bg-tgx21-paper font-tgx21-sans overflow-hidden">
  <div class="px-6 py-10 w-[min(680px,100%)] mx-auto flex flex-col gap-2">
    <p class="text-[0.66rem] tracking-[0.18em] uppercase text-tgx21-accent">Northbeam · Studio</p>
    <h2 class="text-[clamp(1.4rem,3.4vw,2rem)] leading-[1.15] font-semibold text-tgx21-ink tracking-[-0.015em] text-balance">We rebuild interfaces that outgrew their first draft</h2>
    <p class="text-[0.88rem] leading-[1.65] text-tgx21-mut max-w-[52ch]">Design systems, front-end architecture and the unglamorous work of deleting CSS.</p>
  </div>
  <div class="-skew-y-[4deg] *:skew-y-[4deg] my-5 py-[calc(tan(4deg)*50vw*0.25+3rem)] bg-[linear-gradient(110deg,oklch(0.2_0.03_250),oklch(0.26_0.06_215))]">
    <div class="px-6 w-[min(680px,100%)] mx-auto">
      <div class="flex items-baseline justify-between gap-3 flex-wrap mb-5">
        <h3 class="text-tgx21-electric text-[clamp(1.15rem,3vw,1.5rem)] font-semibold">Last twelve months</h3>
        <span class="font-tgx21-mono text-[0.7rem] text-tgx21-banddim">9 engagements · 4 industries</span>
      </div>
      <div class="grid grid-cols-[repeat(auto-fit,minmax(min(160px,100%),1fr))] gap-3">
        <article class="flex flex-col gap-1 rounded-xl border border-tgx21-electric/40 bg-white/10 p-4"><strong class="font-tgx21-mono text-[1.6rem] leading-none text-tgx21-electric tabular-nums">−62%</strong><span class="text-[0.76rem] text-tgx21-banddim">CSS shipped after the rebuild</span></article>
        <article class="flex flex-col gap-1 rounded-xl border border-tgx21-electric/40 bg-white/10 p-4"><strong class="font-tgx21-mono text-[1.6rem] leading-none text-tgx21-electric tabular-nums">0.00</strong><span class="text-[0.76rem] text-tgx21-banddim">Cumulative layout shift, median page</span></article>
        <article class="flex flex-col gap-1 rounded-xl border border-tgx21-electric/40 bg-white/10 p-4"><strong class="font-tgx21-mono text-[1.6rem] leading-none text-tgx21-electric tabular-nums">9 wks</strong><span class="text-[0.76rem] text-tgx21-banddim">Median time from audit to launch</span></article>
      </div>
    </div>
  </div>
  <div class="px-6 py-10 w-[min(680px,100%)] mx-auto flex items-center justify-between gap-4 flex-wrap">
    <p class="text-[0.86rem] leading-[1.6] text-tgx21-mut max-w-[38ch]">The band's edges are transforms, not SVG dividers — they stay sharp at every viewport width.</p>
    <a href="#0" class="inline-flex items-center min-h-11 px-5 rounded-full bg-tgx21-ink text-white text-[0.84rem] font-semibold no-underline transition-colors hover:bg-tgx21-inkhover focus-visible:outline-2 focus-visible:outline-tgx21-ink focus-visible:outline-offset-2">Start a project</a>
  </div>
</section>
@import "tailwindcss";

@theme {
  --color-tgx21-paper: #f3f6f8;
  --color-tgx21-paper: oklch(0.96 0.008 220);
  --color-tgx21-ink: #1b2730;
  --color-tgx21-ink: oklch(0.25 0.02 230);
  --color-tgx21-inkhover: #24333e;
  --color-tgx21-inkhover: oklch(0.31 0.025 230);
  --color-tgx21-mut: #4d5b63;
  --color-tgx21-mut: oklch(0.45 0.02 230);
  --color-tgx21-accent: #0d6f86;
  --color-tgx21-accent: oklch(0.47 0.09 215);
  --color-tgx21-electric: #7ce0ea;
  --color-tgx21-electric: oklch(0.86 0.13 195);
  --color-tgx21-banddim: #c2d2d8;
  --color-tgx21-banddim: oklch(0.84 0.02 220);
  --font-tgx21-sans: 'Inter Tight', system-ui, sans-serif;
  --font-tgx21-mono: 'JetBrains Mono', ui-monospace, monospace;
}

.tgx-21 {
  width: 100%;
  min-height: 100svh;
  --tgx21-angle: 4deg;
}

Setup — do this once per project

Skip this if your project already runs Tailwind v4.

1Load Tailwind
<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.

2Add the stylesheetRequiredthe @theme block is what makes the custom utilities exist
@import "tailwindcss";

@theme {
  --color-tgx21-paper: #f3f6f8;
  --color-tgx21-paper: oklch(0.96 0.008 220);
  --color-tgx21-ink: #1b2730;
  --color-tgx21-ink: oklch(0.25 0.02 230);
  --color-tgx21-inkhover: #24333e;
  --color-tgx21-inkhover: oklch(0.31 0.025 230);
  --color-tgx21-mut: #4d5b63;
  --color-tgx21-mut: oklch(0.45 0.02 230);
  --color-tgx21-accent: #0d6f86;
  --color-tgx21-accent: oklch(0.47 0.09 215);
  --color-tgx21-electric: #7ce0ea;
  --color-tgx21-electric: oklch(0.86 0.13 195);
  --color-tgx21-banddim: #c2d2d8;
  --color-tgx21-banddim: oklch(0.84 0.02 220);
  --font-tgx21-sans: 'Inter Tight', system-ui, sans-serif;
  --font-tgx21-mono: 'JetBrains Mono', ui-monospace, monospace;
}

.tgx-21 {
  width: 100%;
  min-height: 100svh;
  --tgx21-angle: 4deg;
}
3Fonts used by this demooptional — skip if you have your own type stack
<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=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">

What changed in the port

Which parts became utilities, which stayed CSS, and why.

  • The band now sits between real page content above and below, which is the only way to judge the clearance maths — a skewed band in isolation always looks fine.
  • Stat labels are full sentences rather than CSS property names, so the band works as a marketing section and still demonstrates the technique.
  • Product upgrade: '−4deg / +4deg / tan(4°)' cards became agency outcome figures, with an intro block, a band subtitle and a closing CTA row.
Paste this into ChatGPT, Claude, Cursor, or any coding assistant. The block below is pre-framed with everything the AI needs to integrate this demo into your project — markup, styles, scoping notes, and the source URL. Hit Copy and paste straight into your chat.
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 Diagonal Section Band with skewY Counter-Skew
Source: https://codefronts.com/layouts/tailwind-css-grid-layouts/tailwind-diagonal-section-band-skew-counter-skew/

The angled results band every agency site ships: the section skews, its children counter-skew, and the stats grid inside never knows it is tilted. No SVG dividers, no clip-path seams that misalign at odd widths.
## HTML
```html
<section class="tgx-21 w-full min-h-svh bg-tgx21-paper font-tgx21-sans overflow-hidden">
  <div class="px-6 py-10 w-[min(680px,100%)] mx-auto flex flex-col gap-2">
    <p class="text-[0.66rem] tracking-[0.18em] uppercase text-tgx21-accent">Northbeam · Studio</p>
    <h2 class="text-[clamp(1.4rem,3.4vw,2rem)] leading-[1.15] font-semibold text-tgx21-ink tracking-[-0.015em] text-balance">We rebuild interfaces that outgrew their first draft</h2>
    <p class="text-[0.88rem] leading-[1.65] text-tgx21-mut max-w-[52ch]">Design systems, front-end architecture and the unglamorous work of deleting CSS.</p>
  </div>
  <div class="-skew-y-[4deg] *:skew-y-[4deg] my-5 py-[calc(tan(4deg)*50vw*0.25+3rem)] bg-[linear-gradient(110deg,oklch(0.2_0.03_250),oklch(0.26_0.06_215))]">
    <div class="px-6 w-[min(680px,100%)] mx-auto">
      <div class="flex items-baseline justify-between gap-3 flex-wrap mb-5">
        <h3 class="text-tgx21-electric text-[clamp(1.15rem,3vw,1.5rem)] font-semibold">Last twelve months</h3>
        <span class="font-tgx21-mono text-[0.7rem] text-tgx21-banddim">9 engagements · 4 industries</span>
      </div>
      <div class="grid grid-cols-[repeat(auto-fit,minmax(min(160px,100%),1fr))] gap-3">
        <article class="flex flex-col gap-1 rounded-xl border border-tgx21-electric/40 bg-white/10 p-4"><strong class="font-tgx21-mono text-[1.6rem] leading-none text-tgx21-electric tabular-nums">−62%</strong><span class="text-[0.76rem] text-tgx21-banddim">CSS shipped after the rebuild</span></article>
        <article class="flex flex-col gap-1 rounded-xl border border-tgx21-electric/40 bg-white/10 p-4"><strong class="font-tgx21-mono text-[1.6rem] leading-none text-tgx21-electric tabular-nums">0.00</strong><span class="text-[0.76rem] text-tgx21-banddim">Cumulative layout shift, median page</span></article>
        <article class="flex flex-col gap-1 rounded-xl border border-tgx21-electric/40 bg-white/10 p-4"><strong class="font-tgx21-mono text-[1.6rem] leading-none text-tgx21-electric tabular-nums">9 wks</strong><span class="text-[0.76rem] text-tgx21-banddim">Median time from audit to launch</span></article>
      </div>
    </div>
  </div>
  <div class="px-6 py-10 w-[min(680px,100%)] mx-auto flex items-center justify-between gap-4 flex-wrap">
    <p class="text-[0.86rem] leading-[1.6] text-tgx21-mut max-w-[38ch]">The band's edges are transforms, not SVG dividers — they stay sharp at every viewport width.</p>
    <a href="#0" class="inline-flex items-center min-h-11 px-5 rounded-full bg-tgx21-ink text-white text-[0.84rem] font-semibold no-underline transition-colors hover:bg-tgx21-inkhover focus-visible:outline-2 focus-visible:outline-tgx21-ink focus-visible:outline-offset-2">Start a project</a>
  </div>
</section>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-tgx21-paper: #f3f6f8;
  --color-tgx21-paper: oklch(0.96 0.008 220);
  --color-tgx21-ink: #1b2730;
  --color-tgx21-ink: oklch(0.25 0.02 230);
  --color-tgx21-inkhover: #24333e;
  --color-tgx21-inkhover: oklch(0.31 0.025 230);
  --color-tgx21-mut: #4d5b63;
  --color-tgx21-mut: oklch(0.45 0.02 230);
  --color-tgx21-accent: #0d6f86;
  --color-tgx21-accent: oklch(0.47 0.09 215);
  --color-tgx21-electric: #7ce0ea;
  --color-tgx21-electric: oklch(0.86 0.13 195);
  --color-tgx21-banddim: #c2d2d8;
  --color-tgx21-banddim: oklch(0.84 0.02 220);
  --font-tgx21-sans: 'Inter Tight', system-ui, sans-serif;
  --font-tgx21-mono: 'JetBrains Mono', ui-monospace, monospace;
}

.tgx-21 {
  width: 100%;
  min-height: 100svh;
  --tgx21-angle: 4deg;
}
```

How this works

The counter-skew becomes structural. In CSS, .band > * handled it and any new wrapper silently rendered tilted. The *: variant compiles to the same selector but lives on the band, so the rule cannot drift from what it governs.

Transform-only. Skew is compositor work: no layout thrash, no repaint on scroll, and it composes with sticky headers above and below.

Make it yours

  • Change the angle once in --tgx21-angle; skew, counter-skew and clearance follow.
  • Alternate direction per band for a zigzag page rhythm.
  • Keep angles between 2 and 6 degrees — beyond that, counter-skewed text optically drifts.

Gotchas — read before shipping

  • Every DIRECT child needs the counter-skew; *: handles that automatically, hand-written classes do not.
  • Skew changes painted bounds — derive vertical padding from the same angle or content clips.
  • Focus rings skew with the element, so keep interactive items inside the counter-skewed child.

Browser support

ChromeSafariFirefoxEdge
111+16.4+128+111+

tan() needs 2023 engines — hardcode the clearance (tan 4° ≈ 0.07) for older targets.

Techniques used in this demo

Theme tokensset in @theme, used by a utility

Search CodeFronts

Loading…