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
1 change: 1 addition & 0 deletions src/app/(docs)/docs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export default {
["transform-origin", "/docs/transform-origin"],
["transform-style", "/docs/transform-style"],
["translate", "/docs/translate"],
["zoom", "/docs/zoom"],
] as const,
Interactivity: [
["accent-color", "/docs/accent-color"],
Expand Down
8 changes: 8 additions & 0 deletions src/docs/theme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ Defining new theme variables in these namespaces will make new corresponding uti
Perspective utilities like <code>perspective-near</code>
</td>
</tr>
<tr>
<td className="whitespace-nowrap">
<code>--zoom-*</code>
</td>
<td>
Zoom utilities like <code>zoom-compact</code>
</td>
</tr>
<tr>
<td className="whitespace-nowrap">
<code>--aspect-*</code>
Expand Down
48 changes: 48 additions & 0 deletions src/docs/zoom.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { ApiTable } from "@/components/api-table.tsx";
import {
ResponsiveDesign,
TargetingSpecificStates,
UsingACustomValue,
} from "@/components/content.tsx";

export const title = "zoom";
export const description = "Utilities for scaling elements using zoom.";

<ApiTable
rows={[
["zoom-<number>", "zoom: <number>%;"],
["zoom-(<custom-property>)", "zoom: var(<custom-property>);"],
["zoom-[<value>]", "zoom: <value>;"],
]}
/>

## Examples

### Basic example

Use `zoom-<number>` utilities like `zoom-75` and `zoom-125` to scale an element using the CSS `zoom` property:

```html
<!-- [!code classes:zoom-75,zoom-100,zoom-125] -->
<div class="zoom-75 ...">
<!-- ... -->
</div>
<div class="zoom-100 ...">
<!-- ... -->
</div>
<div class="zoom-125 ...">
<!-- ... -->
</div>
```

### Using a custom value

<UsingACustomValue utility="zoom" value="1.1" />

### Applying on hover

<TargetingSpecificStates property="zoom" defaultClass="zoom-100" featuredClass="zoom-125" />

### Responsive design

<ResponsiveDesign property="zoom" defaultClass="zoom-100" featuredClass="zoom-125" />