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 / _add-field-button.scss

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

90 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Dashed "add" button for the bottom-of-canvas "Add field" and the "Add
2 // sub-field" appenders. One shared
3 // look applied to:
4 // • the AddFieldButton component (Columns / Repeater field appenders), and
5 // • the ROOT canvas block appender (the bottom-of-form "Add field" button),
6 // so every "add" affordance reads identically. Tokens: style/_tokens.scss.
7
8 @mixin wppb-fb-add-btn {
9 align-items: center;
10 background: transparent;
11 border: 1px dashed var(--wppb-fb-border-strong);
12 border-radius: var(--wppb-fb-radius-md);
13 box-shadow: none;
14 box-sizing: border-box;
15 color: var(--wppb-fb-text-muted);
16 cursor: pointer;
17 display: flex;
18 // Force row so the icon + label sit inline. Core's root block appender
19 // (`.block-editor-button-block-appender`) sets `flex-direction: column`,
20 // which would otherwise stack the "Add field" label below the "+".
21 flex-direction: row;
22 flex-wrap: nowrap;
23 font-size: var(--wppb-fb-font-md);
24 font-weight: 500;
25 gap: var(--wppb-fb-space-sm);
26 height: 44px;
27 justify-content: center;
28 white-space: nowrap;
29 width: 100%;
30
31 &:hover,
32 &:focus {
33 background: transparent;
34 border-color: var(--wppb-fb-accent);
35 color: var(--wppb-fb-accent);
36 }
37
38 svg {
39 flex: 0 0 auto;
40 }
41 }
42
43 // Component button used as the Columns / Repeater appender. `button.` +
44 // `.components-button` both reached so it beats the @wordpress/components
45 // default Button sizing (height/padding/box-shadow).
46 button.wppb-fb-add-button,
47 .wppb-fb-add-button.components-button {
48 @include wppb-fb-add-btn;
49 margin-top: var(--wppb-fb-space-sm);
50 }
51
52 // <Inserter> wraps the toggle button in a `.block-editor-inserter` dropdown
53 // that's inline-block by default, so the button's `width: 100%` only fills the
54 // shrink-wrapped wrapper. Make the wrapper block-level so the button spans the
55 // container width like the mockup's full-width add buttons.
56 .block-editor-inserter:has( .wppb-fb-add-button ) {
57 display: block;
58 width: 100%;
59 }
60
61 // The rule below uses a bare generic Gutenberg selector (the ROOT canvas
62 // appender), so it is scoped to PB form CPT screens via `.wppb-fb-block-editor`
63 // (see _editor-chrome.scss header) — the bundle stylesheet loads on every
64 // block-editor screen. The appender is inside the canvas iframe, so the marker is
65 // stamped on the iframe <body> too (components/EditorBodyClass.js), not only the
66 // main <body>. Without the scope, EVERY post/page root appender would be restyled
67 // into an "Add field" button and lose its "Browse all". The `.wppb-fb-add-button`
68 // rules above are self-scoped (our own class) and need no wrapper.
69 //
70 // Two quick-inserter rules used to sit here (hide "Browse all", border the
71 // popover). No PB affordance opens core's quick inserter any more: AddFieldButton
72 // omits `__experimentalIsQuick`, RootCanvasAppender replaces core's appender, and
73 // CanvasPointInserter swallows the click on both remaining core "+"s.
74
75 // Root canvas appender → the bottom-of-form "Add field" button. The node is
76 // ours (components/RootCanvasAppender.js appends it to the root block list —
77 // core's own `.block-list-appender` only exists while nothing is selected, and
78 // is hidden in _mini-inserter.scss), so it only needs the gap that separated
79 // core's appender from the last field; the button inside carries the dashed
80 // look already.
81 .wppb-fb-block-editor .block-editor-block-list__layout.is-root-container > .wppb-fb-root-appender {
82 margin-top: 18px;
83
84 // The button's own `margin-top` would stack on top of that gap.
85 button.wppb-fb-add-button,
86 .wppb-fb-add-button.components-button {
87 margin-top: 0;
88 }
89 }
90