You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/02-Live Preview/03-styles-bar.md
+5-22Lines changed: 5 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,45 +3,40 @@ title: Styles Bar
3
3
slug: "/Pro Features/styles-bar"
4
4
---
5
5
6
+
import VideoPlayer from '@site/src/components/Video/player';
7
+
6
8
:::info Pro Feature
7
9
[Upgrade to Phoenix Code Pro](https://phcode.io/pricing) to access this feature.
8
10
:::
9
11
10
12
The **Styles Bar** lets you style elements visually right inside the Live Preview, and it automatically syncs your code in real time.
11
13
When you select an element in [Edit Mode](./live-preview-edit), a bar appears at the bottom of the Live Preview with controls for **fonts**, **colors**, **borders**, **spacing**, **layout**, and more.
12
14
13
-
<!-- TODO: PLUTO - add video here showing the styles bar in action -->
> The controls shown depend on the selected element. For example, text controls are not shown for images.
16
20
17
21
You can move the bar to the top of the Live Preview using the **dock button** at the right end of the bar.
18
22
19
-
<!-- TODO: PLUTO - add image here showing the dock button -->
20
-
21
23
## Save Changes To
22
24
23
25
Phoenix Code gives you control to choose where you want to save your edits. By default, all the changes are saved directly on the element as an inline style. If you want to save the changes in one of the CSS rules, you can click on the **Save changes to** button:
24
-
<!-- TODO: PLUTO - add image here showing the save changes to button -->
25
26
26
27
It shows all the available selectors for that element. Select the one you want, and all the changes made to that element will automatically get saved in that selector.
27
28
> Each selector also shows the number of elements it affects on the page.
28
29
29
-
<!-- TODO: PLUTO - add image here showing the affects x elements -->
30
-
31
30
### Creating a New Rule
32
31
33
32
Click **Create new rule…** to save your edits in a new CSS rule. Type a class like `.card` or an id like `#hero` and click **Create**. Phoenix Code creates the rule and also adds the class or id to the element, so the rule applies right away.
34
33
35
-
<!-- TODO: PLUTO - add video here showing the new rule creation -->
36
-
37
34
### Editing Element States
38
35
39
36
The **State** dropdown in the popover lets you style the element's `hover`, `focus`, and `active` states. Pick a state and the Live Preview turns it on while you edit, with a banner showing which state you are editing.
40
37
41
38
For any other state, type it in the **Create new rule** field, for example `.button:disabled`.
42
39
43
-
<!-- TODO: PLUTO - add video of editing the hover state in the element -->
44
-
45
40
> States need a CSS rule to live in, so they are not available when saving to inline styles.
46
41
47
42
## Font Family
@@ -54,8 +49,6 @@ Opens a font picker with three tabs:
54
49
55
50
Fonts already used on the page appear in an **On this page** group, so you can reuse them quickly.
56
51
57
-
<!-- TODO: PLUTO - add image here showing the font family popover -->
58
-
59
52
## Font Size
60
53
61
54
Sets the font size. Type a value or use the **+/-** buttons. Click the unit button to switch between `px`, `em`, `rem`, and `%`, and the value is converted to the new unit automatically.
@@ -83,8 +76,6 @@ The **Spacing** tab:
83
76
84
77
To learn more about these properties, see [MDN's text styling guide](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Text_styling/Fundamentals).
85
78
86
-
<!-- TODO: PLUTO - add image here showing the text style popover -->
87
-
88
79
> Looking for bold? Use the font weight slider.
89
80
90
81
## Background Color
@@ -96,8 +87,6 @@ The **Background color** button shows the element's current background color. Cl
96
87
- The **eyedropper** lets you pick a color from anywhere on the page.
97
88
-**Swatches** shown on the left side displays all the colors already used in the page, plus a set of common colors.
98
89
99
-
<!-- TODO: PLUTO - add image here showing the background color picker -->
100
-
101
90
> The eyedropper is not available in Firefox, Safari and in the Linux desktop app.
102
91
103
92
## Text Color
@@ -123,8 +112,6 @@ The **Outline** tab has the same style, width, and color options, plus:
123
112
124
113
> An outline is drawn outside the element's border and takes up no space on the page.
125
114
126
-
<!-- TODO: PLUTO - add image here showing the border and outline popover -->
127
-
128
115
## Box Model
129
116
130
117
The popover has three tabs, **Size**, **Padding**, and **Margin**. They sit together because they measure one element from the inside out.
@@ -146,8 +133,6 @@ The button in the center of the frame controls how the sides are linked:
146
133
147
134
Linked fields are color coded so you can see which sides move together.
148
135
149
-
<!-- TODO: PLUTO - add image here showing the box model popover -->
150
-
151
136
## Layout
152
137
153
138
The popover has two tabs, **Display** and **Position**.
@@ -164,8 +149,6 @@ The **Position** tab:
164
149
165
150
To learn more about these properties, see MDN's guides on [display](https://developer.mozilla.org/en-US/docs/Web/CSS/display) and [position](https://developer.mozilla.org/en-US/docs/Web/CSS/position).
166
151
167
-
<!-- TODO: PLUTO - add image here showing the layout popover -->
168
-
169
152
## When a Change Is Overridden
170
153
171
154
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