Skip to content

Commit 206d21f

Browse files
committed
feat: live preview resize ruler docs
1 parent 9292023 commit 206d21f

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Resize Ruler
3+
---
4+
5+
:::info Pro Feature
6+
[Upgrade to Phoenix Code Pro](https://phcode.io/pricing) to access this feature.
7+
:::
8+
9+
The **Resize Ruler** is a ruler that appears on the Live Preview toolbar when you resize the Live Preview panel. It helps you see exactly how wide your preview is and where your page's CSS breakpoints fall.
10+
11+
<!-- Add an image here showing the Resize Ruler on the Live Preview toolbar with tick marks, colored segments, and the width info badge -->
12+
13+
---
14+
15+
## How It Works
16+
17+
Drag the edge of the Live Preview panel to resize it. A ruler appears on the toolbar showing:
18+
19+
- **Tick marks** with pixel numbers every 100px
20+
- **Colored segments** that show the CSS breakpoint ranges from your page's stylesheets (see [CSS Breakpoint Detection](#css-breakpoint-detection))
21+
- **A blue line** at the right edge marking the current width
22+
- **Width and device info** in the top-right corner, showing the width in pixels along with the closest matching device name (for example, "iPad Mini - 768px")
23+
24+
The ruler disappears on its own once you stop resizing.
25+
26+
> The Resize Ruler also appears briefly when you select a device from the Device Size Presets dropdown in the [Live Preview Toolbar](../Features/Live%20Preview/live-preview#live-preview-toolbar).
27+
28+
---
29+
30+
## CSS Breakpoint Detection
31+
32+
Phoenix Code reads your page's stylesheets and picks up any CSS media query breakpoints (like `min-width` and `max-width` rules). These breakpoints show up in two places:
33+
34+
- **On the Resize Ruler**: as colored segments between breakpoints, each labeled with its pixel value.
35+
- **In the Device Size dropdown**: as extra entries at the bottom of the list, shown as `@media Xpx`. Clicking one resizes the Live Preview panel to that width.
36+
37+
> Breakpoints update automatically as you edit your CSS.
38+
39+
<!-- Add an image here showing CSS breakpoint entries in the Device Size dropdown, with the @media labels and the crown icon for free users -->
40+
41+
> CSS breakpoint detection and the breakpoint entries in the Device Size dropdown are available only for Pro users. Free users can still use the predefined device presets.
42+

docs/08-Features/06-Live Preview/01-live-preview.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ Phoenix Code provides various options in the Live Preview toolbar.
135135

136136
---
137137

138+
<!-- Add an image here showing the Device Size Presets button in the toolbar -->
139+
140+
* **Device Size Presets** — A device icon button at the right side of the toolbar. Click it to see a list of common device widths (phones, tablets, and desktops). Pick a device to resize the Live Preview panel to that width. The button icon changes to match the current width category.
141+
On **Phoenix Pro Edition**, the dropdown also shows CSS breakpoints picked up from your page's stylesheets. See [Resize Ruler](../../Pro%20Features/resize-ruler) for details.
142+
143+
---
144+
138145
## Using Live Preview with HTML Files
139146

140147
1. Open the HTML file you want to preview.

0 commit comments

Comments
 (0)