PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 4.0.3
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v4.0.3
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
profile-builder / form-builder / blocks / src / style / _existing-fields.scss

_existing-fields.scss in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 4.0.3, at form-builder/blocks/src/style/_existing-fields.scss

281 lines 10.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Existing Fields panel (hijacked "Existing Fields" inserter tab). Token values
2 // come from style/_tokens.scss.
3 .wppb-fb-existing-fields {
4 // The search box and the empty state reuse Gutenberg's own inserter classes
5 // (`block-editor-inserter__search`, `block-editor-inserter__no-results`) so
6 // they match the "New Fields" tab exactly — padding, centering and sticky
7 // behavior all come from Gutenberg + the shared rule in _editor-chrome.scss.
8 // Hence no padding on the wrapper; the card list supplies its own inset.
9
10 // Sticky header (search + filter). The TOOLBAR owns the sticky behavior, so
11 // the per-search sticky rule from _editor-chrome.scss is neutralized here or
12 // the box would pin independently of — and overlap — the toolbar. This partial
13 // is `@use`d after editor-chrome, so the equal-specificity override wins.
14 &__toolbar {
15 position: sticky;
16 top: 0;
17 z-index: 2;
18 background: var(--wppb-fb-surface-default);
19
20 .block-editor-inserter__search {
21 position: static;
22 top: auto;
23 z-index: auto;
24 }
25 }
26
27 // The control is `isBlock` (width: 100%), so the 16px inset aligning it with
28 // the search input MUST be this wrapper's PADDING — a horizontal margin on a
29 // width:100% element adds to the width and overflows the toolbar.
30 //
31 // padding-bottom is 0 on purpose: the toggle → first-card gap lives on the
32 // list instead (see &__list), because here it would sit inside the sticky
33 // toolbar and never scroll, leaving cards tucked under a pinned white band.
34 &__filter {
35 padding: var(--wppb-fb-space-md) var(--wppb-fb-space-xl) 0;
36
37 // Match the search field so the filter reads as its pair. Gutenberg's
38 // SearchControl draws `1px solid #949494`; the ToggleGroupControl ships a
39 // shorter track with a lighter `#ddd`, so pin both. `#949494` is kept
40 // literal to stay in sync with the search field — not a design token.
41 .components-toggle-group-control {
42 min-height: 40px;
43 border-color: #949494;
44 border-radius: var(--wppb-fb-radius-sm);
45 }
46
47 // The options keep their intrinsic ~34px height, leaving a gap visible
48 // under the selected option's background. Stretch them to the full track.
49 .components-toggle-group-control-option-base {
50 min-height: 40px;
51 }
52 }
53
54 &__list {
55 display: flex;
56 flex-direction: column;
57 gap: var(--wppb-fb-space-sm);
58 list-style: none;
59 margin: 0;
60 // Horizontal inset matches `.block-editor-inserter__search`. The top
61 // padding is the toggle → first-card gap, and lives HERE rather than on
62 // the sticky toolbar so it scrolls away with the list.
63 padding: var(--wppb-fb-space-md) var(--wppb-fb-space-xl) var(--wppb-fb-space-lg);
64 }
65
66 &__card {
67 background: var(--wppb-fb-surface-default);
68 border: 1px solid var(--wppb-fb-border-default);
69 border-radius: var(--wppb-fb-radius-lg);
70 position: relative;
71 transition: border-color 0.15s ease, box-shadow 0.15s ease;
72
73 &:hover {
74 border-color: var(--wppb-fb-border-strong);
75 box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
76 }
77
78 // A faint tint is the "already added" cue, not an opacity dim — dimming
79 // would also dim the hover-revealed actions, which live inside the card.
80 &.is-in-form {
81 background: var(--wppb-fb-surface-canvas);
82
83 // The `:not()` is load-bearing: at (0,3,0) this rule otherwise beats
84 // `.is-selected` (0,2,0) and the selection ring vanishes on hover.
85 &:not(.is-selected):hover {
86 box-shadow: none;
87 }
88 }
89
90 // Sub-field cards (inside a Repeater's expanded panel). Declared BEFORE
91 // `.is-selected` so the selection border wins on `.is-selected.is-subfield`
92 // (equal specificity → source order).
93 &.is-subfield {
94 border-color: var(--wppb-fb-border-default);
95
96 > .wppb-fb-existing-fields__body {
97 padding: var(--wppb-fb-space-xs) var(--wppb-fb-space-md);
98 }
99
100 // Clickable as a whole — they have no `__card-main` wrapper because
101 // they carry no Insert/Delete buttons.
102 cursor: pointer;
103 }
104
105 // Mirrors Gutenberg's "block is selected" indicator, so a card reads as
106 // selected the same way its canvas block does. Must come AFTER
107 // `.is-subfield` (equal specificity → source order).
108 &.is-selected {
109 border-color: var(--wppb-fb-accent);
110 box-shadow: 0 0 0 1px var(--wppb-fb-accent);
111 }
112 }
113
114 // Title row — the actions are absolutely positioned (see &__actions), so
115 // revealing them on hover can't reflow this row or change the card height.
116 &__header {
117 align-items: center;
118 display: flex;
119 margin-bottom: var(--wppb-fb-space-sm);
120 // Reserve the right edge so a long title isn't abruptly covered when the
121 // actions appear.
122 padding-right: var(--wppb-fb-space-2xs);
123 }
124
125 // The nested <ul> shown when a Repeater card is expanded. Lighter background
126 // for the nesting; no extra left indent, so sub-field cards stay aligned with
127 // top-level ones.
128 &__subfields {
129 background: var(--wppb-fb-surface-canvas);
130 border-top: 1px solid var(--wppb-fb-border-default);
131 border-bottom-left-radius: var(--wppb-fb-radius-sm);
132 border-bottom-right-radius: var(--wppb-fb-radius-sm);
133 display: flex;
134 flex-direction: column;
135 gap: var(--wppb-fb-space-2xs);
136 list-style: none;
137 margin: 0;
138 padding: var(--wppb-fb-space-xs);
139
140 > .wppb-fb-existing-fields__card.is-subfield {
141 background: var(--wppb-fb-surface-default);
142 }
143 }
144
145 // The clickable card interior (title row + the Field Type / Meta Name / ID rows).
146 &__card-main {
147 cursor: pointer;
148 padding: var(--wppb-fb-space-xl);
149
150 &:focus-visible {
151 outline: none;
152 }
153 }
154
155 &__body {
156 flex: 1 1 auto;
157 min-width: 0;
158 }
159
160 &__title {
161 align-items: center;
162 color: var(--wppb-fb-text-primary);
163 display: flex;
164 font-weight: 600;
165 gap: var(--wppb-fb-space-xs);
166 line-height: 1.3;
167 min-width: 0;
168
169 // Truncate the title, never the trailing markers — the required asterisk
170 // and sub-field count are fixed-width cues and are excluded here.
171 > :first-child:not(.wppb-fb-existing-fields__subfield-count):not(.wppb-fb-existing-fields__required) {
172 overflow: hidden;
173 text-overflow: ellipsis;
174 white-space: nowrap;
175 }
176 }
177
178 // Required marker — the same `status/danger` asterisk as the canvas field
179 // label and the front-end form, so a required field reads identically
180 // everywhere. Sits before the sub-field-count badge.
181 &__required {
182 color: var(--wppb-fb-status-danger);
183 flex: 0 0 auto;
184 font-weight: 600;
185 line-height: 1;
186 // The title row is a flex container with a `gap` (the title text is an
187 // anonymous flex item, so it applies here); pull it back so the asterisk
188 // reads as part of the title rather than a chip beside it.
189 margin-left: calc(var(--wppb-fb-space-3xs) - var(--wppb-fb-space-xs));
190 }
191
192 // Sub-field count — inline with the title, so a non-empty Repeater is
193 // recognisable without expanding it.
194 &__subfield-count {
195 background: var(--wppb-fb-surface-subtle);
196 border-radius: var(--wppb-fb-radius-pill);
197 color: var(--wppb-fb-text-muted);
198 flex: 0 0 auto;
199 font-size: var(--wppb-fb-font-xs);
200 font-weight: 500;
201 line-height: 1;
202 min-width: 16px;
203 padding: 3px var(--wppb-fb-space-xs);
204 text-align: center;
205 }
206
207 &__row {
208 align-items: baseline;
209 display: flex;
210 font-size: var(--wppb-fb-font-sm);
211 gap: var(--wppb-fb-space-2xs);
212 line-height: 1.3;
213 }
214
215 &__label {
216 color: var(--wppb-fb-text-muted);
217 flex: 0 0 5.5em;
218 }
219
220 &__type {
221 color: var(--wppb-fb-text-muted);
222 overflow: hidden;
223 text-overflow: ellipsis;
224 white-space: nowrap;
225 }
226
227 &__meta {
228 color: var(--wppb-fb-text-muted);
229 font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
230 font-size: var(--wppb-fb-font-xs);
231 overflow: hidden;
232 text-overflow: ellipsis;
233 white-space: nowrap;
234 }
235
236 &__id {
237 color: var(--wppb-fb-text-muted);
238 font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
239 font-size: var(--wppb-fb-font-xs);
240 }
241
242 // Card actions (Delete + Insert/Remove), revealed on hover / selection /
243 // keyboard focus. ABSOLUTELY POSITIONED against `&__card` so toggling their
244 // visibility never changes the card height — the title row can't grow when
245 // the taller buttons appear — and the card-matching background lets them
246 // occlude the end of a long title cleanly.
247 &__actions {
248 position: absolute;
249 top: var(--wppb-fb-space-lg);
250 right: var(--wppb-fb-space-lg);
251 align-items: center;
252 background: var(--wppb-fb-surface-default);
253 display: none;
254 gap: var(--wppb-fb-space-sm);
255 padding-left: var(--wppb-fb-space-sm);
256
257 // Insert / Remove — WP `variant="secondary"` would use
258 // --wp-admin-theme-color; pin to our token so it's the Figma blue.
259 .components-button.is-secondary {
260 box-shadow: inset 0 0 0 1px var(--wppb-fb-accent);
261 color: var(--wppb-fb-accent);
262 }
263
264 // Delete — WP destructive is already red; pin to the token.
265 .components-button.is-destructive {
266 color: var(--wppb-fb-status-danger);
267 }
268 }
269
270 // Match the in-form tint so the actions occlude a long title there too.
271 &__card.is-in-form &__actions {
272 background: var(--wppb-fb-surface-canvas);
273 }
274
275 &__card:hover &__actions,
276 &__card.is-selected &__actions,
277 &__card:focus-within &__actions {
278 display: flex;
279 }
280 }
281