|
| 1 | +import { ApiTable } from "@/components/api-table.tsx"; |
| 2 | +import { CustomizingYourTheme, ResponsiveDesign, UsingACustomValue } from "@/components/content.tsx"; |
| 3 | +import { Example } from "@/components/example.tsx"; |
| 4 | +import { Figure } from "@/components/figure.tsx"; |
| 5 | + |
| 6 | +export const title = "tab-size"; |
| 7 | +export const description = "Utilities for controlling the size of tab characters."; |
| 8 | + |
| 9 | +<ApiTable |
| 10 | + rows={[ |
| 11 | + ["tab-<number>", "tab-size: <number>;"], |
| 12 | + ["tab-(<custom-property>)", "tab-size: var(<custom-property>);"], |
| 13 | + ["tab-[<value>]", "tab-size: <value>;"], |
| 14 | + ]} |
| 15 | +/> |
| 16 | + |
| 17 | +## Examples |
| 18 | + |
| 19 | +### Basic example |
| 20 | + |
| 21 | +Use `tab-<number>` utilities like `tab-2` and `tab-8` to control the size of tab characters: |
| 22 | + |
| 23 | +<Figure> |
| 24 | + |
| 25 | +<Example> |
| 26 | + <div className="grid gap-6 sm:grid-cols-2"> |
| 27 | + <div className="tab-2"> |
| 28 | + <span className="mb-3 block font-mono text-xs font-medium text-gray-500 dark:text-gray-400">tab-2</span> |
| 29 | + |
| 30 | +{/* prettier-ignore */} |
| 31 | +```jsx |
| 32 | +function indent() { |
| 33 | + return 'tabbed'; |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | + </div> |
| 38 | + <div className="tab-8"> |
| 39 | + <span className="mb-3 block font-mono text-xs font-medium text-gray-500 dark:text-gray-400">tab-8</span> |
| 40 | + |
| 41 | +{/* prettier-ignore */} |
| 42 | +```jsx |
| 43 | +function indent() { |
| 44 | + return 'tabbed'; |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | + </div> |
| 49 | + |
| 50 | + </div> |
| 51 | +</Example> |
| 52 | + |
| 53 | +```html |
| 54 | +<!-- [!code classes:tab-2,tab-8] --> |
| 55 | +<pre class="tab-2 ...">function indent() { 	return 'tabbed' }</pre> |
| 56 | +<pre class="tab-8 ...">function indent() { 	return 'tabbed' }</pre> |
| 57 | +``` |
| 58 | + |
| 59 | +</Figure> |
| 60 | + |
| 61 | +### Using a custom value |
| 62 | + |
| 63 | +<UsingACustomValue element="pre" utility="tab" name="tab size" value="12px" variable="tab-size" /> |
| 64 | + |
| 65 | +### Responsive design |
| 66 | + |
| 67 | +<ResponsiveDesign element="pre" property="tab-size" defaultClass="tab-4" featuredClass="tab-8" /> |
| 68 | + |
| 69 | +## Customizing your theme |
| 70 | + |
| 71 | +<CustomizingYourTheme |
| 72 | + element="pre" |
| 73 | + utility="tab" |
| 74 | + themeKey="tab-size" |
| 75 | + name="tab size" |
| 76 | + customName="github" |
| 77 | + customValue="8" |
| 78 | +/> |
0 commit comments