// Existing Fields panel (hijacked "Existing Fields" inserter tab). Token values // come from style/_tokens.scss. .wppb-fb-existing-fields { // The search box and the empty state reuse Gutenberg's own inserter classes // (`block-editor-inserter__search`, `block-editor-inserter__no-results`) so // they match the "New Fields" tab exactly — padding, centering and sticky // behavior all come from Gutenberg + the shared rule in _editor-chrome.scss. // Hence no padding on the wrapper; the card list supplies its own inset. // Sticky header (search + filter). The TOOLBAR owns the sticky behavior, so // the per-search sticky rule from _editor-chrome.scss is neutralized here or // the box would pin independently of — and overlap — the toolbar. This partial // is `@use`d after editor-chrome, so the equal-specificity override wins. &__toolbar { position: sticky; top: 0; z-index: 2; background: var(--wppb-fb-surface-default); .block-editor-inserter__search { position: static; top: auto; z-index: auto; } } // The control is `isBlock` (width: 100%), so the 16px inset aligning it with // the search input MUST be this wrapper's PADDING — a horizontal margin on a // width:100% element adds to the width and overflows the toolbar. // // padding-bottom is 0 on purpose: the toggle → first-card gap lives on the // list instead (see &__list), because here it would sit inside the sticky // toolbar and never scroll, leaving cards tucked under a pinned white band. &__filter { padding: var(--wppb-fb-space-md) var(--wppb-fb-space-xl) 0; // Match the search field so the filter reads as its pair. Gutenberg's // SearchControl draws `1px solid #949494`; the ToggleGroupControl ships a // shorter track with a lighter `#ddd`, so pin both. `#949494` is kept // literal to stay in sync with the search field — not a design token. .components-toggle-group-control { min-height: 40px; border-color: #949494; border-radius: var(--wppb-fb-radius-sm); } // The options keep their intrinsic ~34px height, leaving a gap visible // under the selected option's background. Stretch them to the full track. .components-toggle-group-control-option-base { min-height: 40px; } } &__list { display: flex; flex-direction: column; gap: var(--wppb-fb-space-sm); list-style: none; margin: 0; // Horizontal inset matches `.block-editor-inserter__search`. The top // padding is the toggle → first-card gap, and lives HERE rather than on // the sticky toolbar so it scrolls away with the list. padding: var(--wppb-fb-space-md) var(--wppb-fb-space-xl) var(--wppb-fb-space-lg); } &__card { background: var(--wppb-fb-surface-default); border: 1px solid var(--wppb-fb-border-default); border-radius: var(--wppb-fb-radius-lg); position: relative; transition: border-color 0.15s ease, box-shadow 0.15s ease; &:hover { border-color: var(--wppb-fb-border-strong); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); } // A faint tint is the "already added" cue, not an opacity dim — dimming // would also dim the hover-revealed actions, which live inside the card. &.is-in-form { background: var(--wppb-fb-surface-canvas); // The `:not()` is load-bearing: at (0,3,0) this rule otherwise beats // `.is-selected` (0,2,0) and the selection ring vanishes on hover. &:not(.is-selected):hover { box-shadow: none; } } // Sub-field cards (inside a Repeater's expanded panel). Declared BEFORE // `.is-selected` so the selection border wins on `.is-selected.is-subfield` // (equal specificity → source order). &.is-subfield { border-color: var(--wppb-fb-border-default); > .wppb-fb-existing-fields__body { padding: var(--wppb-fb-space-xs) var(--wppb-fb-space-md); } // Clickable as a whole — they have no `__card-main` wrapper because // they carry no Insert/Delete buttons. cursor: pointer; } // Mirrors Gutenberg's "block is selected" indicator, so a card reads as // selected the same way its canvas block does. Must come AFTER // `.is-subfield` (equal specificity → source order). &.is-selected { border-color: var(--wppb-fb-accent); box-shadow: 0 0 0 1px var(--wppb-fb-accent); } } // Title row — the actions are absolutely positioned (see &__actions), so // revealing them on hover can't reflow this row or change the card height. &__header { align-items: center; display: flex; margin-bottom: var(--wppb-fb-space-sm); // Reserve the right edge so a long title isn't abruptly covered when the // actions appear. padding-right: var(--wppb-fb-space-2xs); } // The nested