Skip to content

Commit b9fd3ac

Browse files
committed
feat: write docs for remove reset feature in styles bar
1 parent 9e5170a commit b9fd3ac

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

docs/02-Live Preview/03-styles-bar.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,42 @@ To learn more about these properties, see MDN's guides on [display](https://deve
191191
src="https://docs-images.phcode.dev/videos/styles-bar/layout.mp4"
192192
/>
193193

194+
## Removing a Style
195+
196+
Right-click any control inside a popover, like a number field, a color swatch, or a dropdown, to open a menu with three actions: [Remove](#remove), [Reset to browser default](#reset-to-browser-default), and **Learn more…**.
197+
198+
**Learn more…** opens this documentation page in your browser, so you can read it whenever you need help.
199+
200+
### Remove
201+
202+
**Remove `<property>`** deletes the style from wherever it is actually written in your code. The line under it tells you where that is, either the CSS rule and its file, like `.card (style.css)`, or **this element's inline style**.
203+
204+
> For number fields, you can also just empty the field to remove the style, without opening the menu.
205+
206+
For a CSS rule, it also shows how many elements that rule affects, so you know what else on the page changes when you delete it.
207+
208+
This action is disabled in two cases:
209+
210+
- **Not set on this element**: there is nothing to remove.
211+
- **Set by a shorthand, use Reset instead**: the value comes from a shorthand like `font` or `border`. Deleting that line would take the other values in it along too, so use **Reset to browser default** instead.
212+
213+
### Reset to Browser Default
214+
215+
**Reset to browser default** puts the property back to what the browser uses when no CSS sets it. The line under it shows exactly what gets added, for example `font-size: revert`.
216+
217+
This action is always available. It writes on the element itself, so only that one element changes even when the value comes from a shared rule. It also works for values coming from a rule you cannot edit, like one in a library stylesheet.
218+
219+
> This is not the same as the **Reset** button in the popover header. That one only undoes the changes you made since opening the popover. See [Reset and Undo](#reset-and-undo).
220+
221+
## When a Field Will Not Clear
222+
223+
Sometimes you empty a field and the old value comes straight back. That happens when the value is written somewhere your current [Save changes to](#save-changes-to) target cannot reach.
224+
225+
Phoenix Code shows a notice telling you where the value really lives, for example *Font Size is set by `.card (style.css)`*, with buttons to fix it:
226+
227+
- **Remove**: deletes the style at that place, the same as the menu action above. This button only shows up when the style can be deleted on its own.
228+
- **Reset**: adds `revert` on this element only.
229+
194230
## When a Change Is Overridden
195231

196232
Sometimes a more specific CSS rule wins over the rule you are editing, so your change has no visible effect. In that case, Phoenix Code automatically adds `!important` to your change to make it take effect.

0 commit comments

Comments
 (0)