17 / 32
All 32 in 32 Tailwind CSS Tabs
- 01Tailwind CSS Tabs with Sliding Underline Indicator
- 02Neon Glow Tailwind Tabs with Per-Tab Accent Colors
- 03Neo-Brutalist Tailwind Tabs with Press Effect
- 04Color-Coded Tailwind CSS Tabs Component
- 05VS Code Style File Tabs in Tailwind CSS
- 06iOS Segmented Control in Tailwind CSS
- 07Bento Grid Card Tabs in Tailwind CSS
- 08Vertical Tabs with Timeline Progress in Tailwind CSS
- 09Terminal Window Tabs in Tailwind CSS (Retro CRT)
- 10Expanding Icon Tabs in Tailwind CSS
- 11Typewriter Animation Tabs in Tailwind CSS
- 12Tailwind Tabs with Particle Burst Animation
- 13Animated Counter Tabs in Tailwind CSS (Type Specimen)
- 14Oversized Cropped Text Tabs in Tailwind CSS
- 15Tailwind Sidebar Navigation with Sliding Indicator
- 16Tailwind Bottom Navigation Bar with Expanding Labels
- 17Variable Font Weight Tabs in Tailwind CSS
- 18Uppercase Tabs with Thick Sliding Bar in Tailwind CSS
- 19Drop Cap Initial Letter Tabs in Tailwind CSS
- 20Industrial Stencil Tabs in Tailwind CSS
- 21Bracket Selection Tabs in Tailwind CSS
- 22Bauhaus Color Block Tabs in Tailwind CSS
- 23Inverted Rubber Stamp Tabs in Tailwind CSS
- 24Outlined Tabs with Corner Markers in Tailwind CSS
- 25Tailwind Pill Tab Bar with Icons
- 26Risograph Print Effect Tabs in Tailwind CSS
- 27Animated SVG Underline Tabs in Tailwind CSS
- 28Font Specimen Glyph Tabs in Tailwind CSS
- 29Sliding Pill Tabs with Icons in Tailwind CSS
- 30Folded Corner Tabs in Tailwind CSS (clip-path)
- 31Bookmark Ribbon Navigation in Tailwind CSS
- 32Neumorphic Inset Tabs in Tailwind CSS
Variable Font Weight Tabs in Tailwind CSS
Pure type-weight contrast: inactive labels are 200 hairline, the active one dials up to 900 black on Geist's variable axis while a violet rule draws in. The port fixes the original's layout jitter — bolding a word makes it wider and shoved its neighbours — by reserving each label's black-weight width with an invisible twin.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<section class="ttb-17 group/tabs grid min-h-svh w-full place-items-center bg-ttb17-bg px-5 py-14 font-ttb17-sans text-ttb17-paper" aria-label="Variable font weight tabs demo">
<div class="grid w-full max-w-xl justify-items-start gap-7">
<div role="radiogroup" aria-label="Project section" class="flex flex-wrap gap-x-8 gap-y-3">
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r1" checked><span class="grid [&>*]:[grid-area:1/1]"><span>Overview</span><span aria-hidden="true" class="invisible font-black">Overview</span></span></label>
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r2"><span class="grid [&>*]:[grid-area:1/1]"><span>Activity</span><span aria-hidden="true" class="invisible font-black">Activity</span></span></label>
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r3"><span class="grid [&>*]:[grid-area:1/1]"><span>Settings</span><span aria-hidden="true" class="invisible font-black">Settings</span></span></label>
</div>
<div class="max-w-[42ch] font-ttb17-serif text-[16px] leading-relaxed text-ttb17-mut">
<p class="hidden group-has-[#ttb17-r1:checked]/tabs:block">A summary of the project, its members and the decisions made so far.</p>
<p class="hidden group-has-[#ttb17-r2:checked]/tabs:block">Edits, comments and team mentions over the last seven days.</p>
<p class="hidden group-has-[#ttb17-r3:checked]/tabs:block">Permissions, integrations and billing controls.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb17-mono text-[11.5px] text-ttb17-mut">font-extralight → font-black · invisible twin = 0 CLS</p>
</div>
</section><section class="ttb-17 group/tabs grid min-h-svh w-full place-items-center bg-ttb17-bg px-5 py-14 font-ttb17-sans text-ttb17-paper" aria-label="Variable font weight tabs demo">
<div class="grid w-full max-w-xl justify-items-start gap-7">
<div role="radiogroup" aria-label="Project section" class="flex flex-wrap gap-x-8 gap-y-3">
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r1" checked><span class="grid [&>*]:[grid-area:1/1]"><span>Overview</span><span aria-hidden="true" class="invisible font-black">Overview</span></span></label>
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r2"><span class="grid [&>*]:[grid-area:1/1]"><span>Activity</span><span aria-hidden="true" class="invisible font-black">Activity</span></span></label>
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r3"><span class="grid [&>*]:[grid-area:1/1]"><span>Settings</span><span aria-hidden="true" class="invisible font-black">Settings</span></span></label>
</div>
<div class="max-w-[42ch] font-ttb17-serif text-[16px] leading-relaxed text-ttb17-mut">
<p class="hidden group-has-[#ttb17-r1:checked]/tabs:block">A summary of the project, its members and the decisions made so far.</p>
<p class="hidden group-has-[#ttb17-r2:checked]/tabs:block">Edits, comments and team mentions over the last seven days.</p>
<p class="hidden group-has-[#ttb17-r3:checked]/tabs:block">Permissions, integrations and billing controls.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb17-mono text-[11.5px] text-ttb17-mut">font-extralight → font-black · invisible twin = 0 CLS</p>
</div>
</section>@import "tailwindcss";
@theme {
--color-ttb17-bg: #14141c;
--color-ttb17-bg: oklch(0.195 0.016 284.8);
--color-ttb17-paper: #ece6d4;
--color-ttb17-paper: oklch(0.925 0.025 91.6);
--color-ttb17-mut: #b0aa9b;
--color-ttb17-mut: oklch(0.739 0.022 88.8);
--color-ttb17-acc: #8b6dff;
--color-ttb17-acc: oklch(0.638 0.208 288.5);
--font-ttb17-sans: 'Geist', system-ui, sans-serif;
--font-ttb17-serif: 'Newsreader', Georgia, serif;
--font-ttb17-mono: 'Geist Mono', ui-monospace, monospace;
}
/* 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. */
.ttb-17 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-ttb17-bg: #14141c;
--color-ttb17-bg: oklch(0.195 0.016 284.8);
--color-ttb17-paper: #ece6d4;
--color-ttb17-paper: oklch(0.925 0.025 91.6);
--color-ttb17-mut: #b0aa9b;
--color-ttb17-mut: oklch(0.739 0.022 88.8);
--color-ttb17-acc: #8b6dff;
--color-ttb17-acc: oklch(0.638 0.208 288.5);
--font-ttb17-sans: 'Geist', system-ui, sans-serif;
--font-ttb17-serif: 'Newsreader', Georgia, serif;
--font-ttb17-mono: 'Geist Mono', ui-monospace, monospace;
}
/* 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. */
.ttb-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-ttb17-bg: #14141c;
--color-ttb17-bg: oklch(0.195 0.016 284.8);
--color-ttb17-paper: #ece6d4;
--color-ttb17-paper: oklch(0.925 0.025 91.6);
--color-ttb17-mut: #b0aa9b;
--color-ttb17-mut: oklch(0.739 0.022 88.8);
--color-ttb17-acc: #8b6dff;
--color-ttb17-acc: oklch(0.638 0.208 288.5);
--font-ttb17-sans: 'Geist', system-ui, sans-serif;
--font-ttb17-serif: 'Newsreader', Georgia, serif;
--font-ttb17-mono: 'Geist Mono', ui-monospace, monospace;
}
/* 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. */
.ttb-17 {
width: 100%;
min-height: 100svh;
}@import "tailwindcss";
@theme {
--color-ttb17-bg: #14141c;
--color-ttb17-bg: oklch(0.195 0.016 284.8);
--color-ttb17-paper: #ece6d4;
--color-ttb17-paper: oklch(0.925 0.025 91.6);
--color-ttb17-mut: #b0aa9b;
--color-ttb17-mut: oklch(0.739 0.022 88.8);
--color-ttb17-acc: #8b6dff;
--color-ttb17-acc: oklch(0.638 0.208 288.5);
--font-ttb17-sans: 'Geist', system-ui, sans-serif;
--font-ttb17-serif: 'Newsreader', Georgia, serif;
--font-ttb17-mono: 'Geist Mono', ui-monospace, monospace;
}
/* 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. */
.ttb-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@100..900&family=Newsreader:ital,opsz,wght@0,6..72,400..600;1,6..72,400..600&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@100..900&family=Newsreader:ital,opsz,wght@0,6..72,400..600;1,6..72,400..600&family=Geist+Mono:wght@400..600&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
font-weightplusfont-variation-settings:"wght"collapsed tofont-extralight/has-checked:font-black— with a real variable font loaded, the weight utility alone animates the axis.- The
::afterrule becameafter:scale-x-0 has-checked:after:scale-x-100. - UI upgrade from the CSS original: bug fix — bolding the active label widened it and pushed every later tab sideways on each click; an invisible
font-blacktwin in the same grid cell now reserves the final width (zero layout shift). - UI upgrade: the font is Geist with a true 100–900 axis (the original relied on whatever
ui-sans-serifresolved to, usually not variable), plus a keyboard focus ring.
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: Variable Font Weight Tabs in Tailwind CSS
Source: https://codefronts.com/navigation/tailwind-css-tabs/variable-font-weight-tabs-tailwind-css/
Pure type-weight contrast: inactive labels are 200 hairline, the active one dials up to 900 black on Geist's variable axis while a violet rule draws in. The port fixes the original's layout jitter — bolding a word makes it wider and shoved its neighbours — by reserving each label's black-weight width with an invisible twin.
## HTML
```html
<section class="ttb-17 group/tabs grid min-h-svh w-full place-items-center bg-ttb17-bg px-5 py-14 font-ttb17-sans text-ttb17-paper" aria-label="Variable font weight tabs demo">
<div class="grid w-full max-w-xl justify-items-start gap-7">
<div role="radiogroup" aria-label="Project section" class="flex flex-wrap gap-x-8 gap-y-3">
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r1" checked><span class="grid [&>*]:[grid-area:1/1]"><span>Overview</span><span aria-hidden="true" class="invisible font-black">Overview</span></span></label>
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r2"><span class="grid [&>*]:[grid-area:1/1]"><span>Activity</span><span aria-hidden="true" class="invisible font-black">Activity</span></span></label>
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r3"><span class="grid [&>*]:[grid-area:1/1]"><span>Settings</span><span aria-hidden="true" class="invisible font-black">Settings</span></span></label>
</div>
<div class="max-w-[42ch] font-ttb17-serif text-[16px] leading-relaxed text-ttb17-mut">
<p class="hidden group-has-[#ttb17-r1:checked]/tabs:block">A summary of the project, its members and the decisions made so far.</p>
<p class="hidden group-has-[#ttb17-r2:checked]/tabs:block">Edits, comments and team mentions over the last seven days.</p>
<p class="hidden group-has-[#ttb17-r3:checked]/tabs:block">Permissions, integrations and billing controls.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb17-mono text-[11.5px] text-ttb17-mut">font-extralight → font-black · invisible twin = 0 CLS</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-ttb17-bg: #14141c;
--color-ttb17-bg: oklch(0.195 0.016 284.8);
--color-ttb17-paper: #ece6d4;
--color-ttb17-paper: oklch(0.925 0.025 91.6);
--color-ttb17-mut: #b0aa9b;
--color-ttb17-mut: oklch(0.739 0.022 88.8);
--color-ttb17-acc: #8b6dff;
--color-ttb17-acc: oklch(0.638 0.208 288.5);
--font-ttb17-sans: 'Geist', system-ui, sans-serif;
--font-ttb17-serif: 'Newsreader', Georgia, serif;
--font-ttb17-mono: 'Geist Mono', ui-monospace, monospace;
}
/* 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. */
.ttb-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: Variable Font Weight Tabs in Tailwind CSS
Source: https://codefronts.com/navigation/tailwind-css-tabs/variable-font-weight-tabs-tailwind-css/
Pure type-weight contrast: inactive labels are 200 hairline, the active one dials up to 900 black on Geist's variable axis while a violet rule draws in. The port fixes the original's layout jitter — bolding a word makes it wider and shoved its neighbours — by reserving each label's black-weight width with an invisible twin.
## HTML
```html
<section class="ttb-17 group/tabs grid min-h-svh w-full place-items-center bg-ttb17-bg px-5 py-14 font-ttb17-sans text-ttb17-paper" aria-label="Variable font weight tabs demo">
<div class="grid w-full max-w-xl justify-items-start gap-7">
<div role="radiogroup" aria-label="Project section" class="flex flex-wrap gap-x-8 gap-y-3">
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r1" checked><span class="grid [&>*]:[grid-area:1/1]"><span>Overview</span><span aria-hidden="true" class="invisible font-black">Overview</span></span></label>
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r2"><span class="grid [&>*]:[grid-area:1/1]"><span>Activity</span><span aria-hidden="true" class="invisible font-black">Activity</span></span></label>
<label class="group/tab relative cursor-pointer pb-2.5 text-[28px] leading-none font-extralight tracking-[-0.02em] transition-[font-weight] duration-500 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:origin-left after:scale-x-0 after:bg-ttb17-acc after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.65,0,0.35,1)] hover:font-normal has-checked:font-black has-checked:after:scale-x-100 has-focus-visible:outline-2 has-focus-visible:outline-offset-4 has-focus-visible:outline-ttb17-acc motion-reduce:transition-none motion-reduce:after:transition-none"><input class="sr-only" type="radio" name="ttb17" id="ttb17-r3"><span class="grid [&>*]:[grid-area:1/1]"><span>Settings</span><span aria-hidden="true" class="invisible font-black">Settings</span></span></label>
</div>
<div class="max-w-[42ch] font-ttb17-serif text-[16px] leading-relaxed text-ttb17-mut">
<p class="hidden group-has-[#ttb17-r1:checked]/tabs:block">A summary of the project, its members and the decisions made so far.</p>
<p class="hidden group-has-[#ttb17-r2:checked]/tabs:block">Edits, comments and team mentions over the last seven days.</p>
<p class="hidden group-has-[#ttb17-r3:checked]/tabs:block">Permissions, integrations and billing controls.</p>
</div>
<p aria-hidden="true" class="rounded-full border border-white/10 px-3.5 py-2 font-ttb17-mono text-[11.5px] text-ttb17-mut">font-extralight → font-black · invisible twin = 0 CLS</p>
</div>
</section>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-ttb17-bg: #14141c;
--color-ttb17-bg: oklch(0.195 0.016 284.8);
--color-ttb17-paper: #ece6d4;
--color-ttb17-paper: oklch(0.925 0.025 91.6);
--color-ttb17-mut: #b0aa9b;
--color-ttb17-mut: oklch(0.739 0.022 88.8);
--color-ttb17-acc: #8b6dff;
--color-ttb17-acc: oklch(0.638 0.208 288.5);
--font-ttb17-sans: 'Geist', system-ui, sans-serif;
--font-ttb17-serif: 'Newsreader', Georgia, serif;
--font-ttb17-mono: 'Geist Mono', ui-monospace, monospace;
}
/* 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. */
.ttb-17 {
width: 100%;
min-height: 100svh;
}
```How this works
Bold text is wider text. Animating 200 → 900 widens the word by ~15%, so every tab to its right slides on each click. The fix is to size the cell for the heaviest state up front:
<span class="grid [&>*]:[grid-area:1/1]">
<span>Overview</span>
<span aria-hidden="true" class="invisible font-black">Overview</span>
</span>Both copies share one grid cell; the invisible black copy sets the width, the visible one animates freely inside it. Geist ships a true 100–900 wght axis, so the transition is a smooth dial rather than a snap.
Make it yours
- Softer contrast:
font-light→font-extraboldkeeps inactive labels more legible. - Serif version: Fraunces also has a full weight axis.
- Recolour the rule via
--color-ttb17-acc.
Gotchas — read before shipping
- A static (non-variable) font snaps between weights — still correct, just not animated.
- Keep the invisible twin's text identical to the visible label or the cell sizes wrong.
- 200-weight text needs a large size and high contrast; it's 26px on a near-black stage here.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
Font-weight interpolation on variable fonts is universal in evergreen engines.