Skip to content

Commit 05e875d

Browse files
authored
Document zoom-* utilities (#2484)
Direct link: https://tailwindcss-com-git-feat-document-zoom-utilities-tailwindlabs.vercel.app/docs/zoom This PR documents the `zoom-*` utilities introduced by: tailwindlabs/tailwindcss#20020
1 parent 889f71c commit 05e875d

3 files changed

Lines changed: 57 additions & 0 deletions

File tree

src/app/(docs)/docs/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ export default {
208208
["transform-origin", "/docs/transform-origin"],
209209
["transform-style", "/docs/transform-style"],
210210
["translate", "/docs/translate"],
211+
["zoom", "/docs/zoom"],
211212
] as const,
212213
Interactivity: [
213214
["accent-color", "/docs/accent-color"],

src/docs/theme.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ Defining new theme variables in these namespaces will make new corresponding uti
262262
Perspective utilities like <code>perspective-near</code>
263263
</td>
264264
</tr>
265+
<tr>
266+
<td className="whitespace-nowrap">
267+
<code>--zoom-*</code>
268+
</td>
269+
<td>
270+
Zoom utilities like <code>zoom-compact</code>
271+
</td>
272+
</tr>
265273
<tr>
266274
<td className="whitespace-nowrap">
267275
<code>--aspect-*</code>

src/docs/zoom.mdx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { ApiTable } from "@/components/api-table.tsx";
2+
import {
3+
ResponsiveDesign,
4+
TargetingSpecificStates,
5+
UsingACustomValue,
6+
} from "@/components/content.tsx";
7+
8+
export const title = "zoom";
9+
export const description = "Utilities for scaling elements using zoom.";
10+
11+
<ApiTable
12+
rows={[
13+
["zoom-<number>", "zoom: <number>%;"],
14+
["zoom-(<custom-property>)", "zoom: var(<custom-property>);"],
15+
["zoom-[<value>]", "zoom: <value>;"],
16+
]}
17+
/>
18+
19+
## Examples
20+
21+
### Basic example
22+
23+
Use `zoom-<number>` utilities like `zoom-75` and `zoom-125` to scale an element using the CSS `zoom` property:
24+
25+
```html
26+
<!-- [!code classes:zoom-75,zoom-100,zoom-125] -->
27+
<div class="zoom-75 ...">
28+
<!-- ... -->
29+
</div>
30+
<div class="zoom-100 ...">
31+
<!-- ... -->
32+
</div>
33+
<div class="zoom-125 ...">
34+
<!-- ... -->
35+
</div>
36+
```
37+
38+
### Using a custom value
39+
40+
<UsingACustomValue utility="zoom" value="1.1" />
41+
42+
### Applying on hover
43+
44+
<TargetingSpecificStates property="zoom" defaultClass="zoom-100" featuredClass="zoom-125" />
45+
46+
### Responsive design
47+
48+
<ResponsiveDesign property="zoom" defaultClass="zoom-100" featuredClass="zoom-125" />

0 commit comments

Comments
 (0)