Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"seedrandom": "^3.0.5",
"simple-functional-loader": "^1.2.1",
"stringify-object": "^3.3.0",
"tailwindcss": "^3.2.4",
"tailwindcss": "^0.0.0-insiders.ea10bb9",
"tinytime": "^0.2.6",
"unist-util-visit": "^2.0.3",
"zustand": "^4.0.0-rc.0"
Expand Down
40 changes: 40 additions & 0 deletions src/pages/docs/font-size.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,46 @@ Control the font size of an element using the `text-{size}` utilities.
<p class="**text-2xl** ...">The quick brown fox ...</p>
```

### Setting the line-height

Set an element's line-height at the same time you set the font size by adding a line-height modifier to any font size utility. For example, use `text-xl/8` to set a font size of `1.25rem` with a line-height of `2rem`.

<Example>
<div class="flex flex-col gap-8">
<div>
<span class="font-medium text-sm text-slate-500 font-mono mb-3 dark:text-slate-400">text-base/6</span>
<p class="text-base/6 text-slate-900 dark:text-slate-200">
So I started to walk into the water. I won't lie to you boys, I was terrified. But I pressed on, and as I made my way past the breakers a strange calm came over me. I don't know if it was divine intervention or the kinship of all living things but I tell you Jerry at that moment, I <em>was</em> a marine biologist.
</p>
</div>
<div>
<span class="font-medium text-sm text-slate-500 font-mono mb-3 dark:text-slate-400">text-base/7</span>
<p class="text-base/7 text-slate-900 dark:text-slate-200">
So I started to walk into the water. I won't lie to you boys, I was terrified. But I pressed on, and as I made my way past the breakers a strange calm came over me. I don't know if it was divine intervention or the kinship of all living things but I tell you Jerry at that moment, I <em>was</em> a marine biologist.
</p>
</div>
<div>
<span class="font-medium text-sm text-slate-500 font-mono mb-3 dark:text-slate-400">text-base/8</span>
<p class="text-base/8 text-slate-900 dark:text-slate-200">
So I started to walk into the water. I won't lie to you boys, I was terrified. But I pressed on, and as I made my way past the breakers a strange calm came over me. I don't know if it was divine intervention or the kinship of all living things but I tell you Jerry at that moment, I <em>was</em> a marine biologist.
</p>
</div>
</div>
</Example>


```html
<p class="**text-base/6** ...">So I started to walk into the water...</p>
<p class="**text-base/7** ...">So I started to walk into the water...</p>
<p class="**text-base/8** ...">So I started to walk into the water...</p>
```

You can use any value defined in your [line-height scale](/docs/line-height), or use arbitrary values if you need to deviate from your design tokens.

```html
<p class="text-sm**/[17px]** ..."></p>
```

---

## <Heading ignore>Applying conditionally</Heading>
Expand Down