Skip to content

Commit b13c02c

Browse files
committed
document zoom-* utilities
1 parent b5f08df commit b13c02c

3 files changed

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

0 commit comments

Comments
 (0)