1. Typography
  2. tab-size

Typography

tab-size

Utilities for controlling the size of tab characters.

ClassStyles
tab-<number>
tab-size: <number>;
tab-(<custom-property>)
tab-size: var(<custom-property>);
tab-[<value>]
tab-size: <value>;

Examples

Basic example

Use tab-<number> utilities like tab-2 and tab-8 to control the size of tab characters:

tab-2
function indent() {	return 'tabbed';}
tab-8
function indent() {	return 'tabbed';}
<pre class="tab-2 ...">function indent() {&#10;&#9;return 'tabbed'&#10;}</pre><pre class="tab-8 ...">function indent() {&#10;&#9;return 'tabbed'&#10;}</pre>

Using a custom value

Use the tab-[<value>] syntax to set the tab size based on a completely custom value:

<pre class="tab-[12px] ...">  <!-- ... --></pre>

For CSS variables, you can also use the tab-(<custom-property>) syntax:

<pre class="tab-(--my-tab-size) ...">  <!-- ... --></pre>

This is just a shorthand for tab-[var(<custom-property>)] that adds the var() function for you automatically.

Responsive design

Prefix a tab-size utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

<pre class="tab-4 md:tab-8 ...">  <!-- ... --></pre>

Learn more about using variants in the variants documentation.

Customizing your theme

Use the --tab-size-* theme variables to customize the tab size utilities in your project:

@theme {  --tab-size-github: 8; }

Now the tab-github utility can be used in your markup:

<pre class="tab-github">  <!-- ... --></pre>

Learn more about customizing your theme in the theme documentation.

Copyright © 2026 Tailwind Labs Inc.·Trademark Policy