| 1 |
// Form Fields in Columns — wrapper block. |
| 2 |
// |
| 3 |
// A dashed-outline box with a small |
| 4 |
// "COLUMNS" tab overlapping the top-left border. Editor preview keeps the |
| 5 |
// frontend's `.ffc-wrapper` flex layout so what-you-see matches what-renders. |
| 6 |
// Token values come from style/_tokens.scss. |
| 7 |
.wppb-fb-ffc-columns { |
| 8 |
border: 1px dashed var(--wppb-fb-border-strong); |
| 9 |
border-radius: var(--wppb-fb-radius-md); |
| 10 |
// See _field-block.scss: border-box so the content-size caps total width |
| 11 |
// and every PB block lines up at the same width. |
| 12 |
box-sizing: border-box; |
| 13 |
margin: var(--wppb-fb-space-md) 0; |
| 14 |
padding: var(--wppb-fb-space-xl) var(--wppb-fb-space-lg) var(--wppb-fb-space-lg); |
| 15 |
position: relative; |
| 16 |
|
| 17 |
&:hover { |
| 18 |
border-color: #b1b1b5; // one-off hover gray, between border-strong and text-faint |
| 19 |
} |
| 20 |
|
| 21 |
// The overlapping corner tab. `background:#fff` cuts the dashed border so |
| 22 |
// the label reads as a tab on the (white) editor canvas. |
| 23 |
&__tab { |
| 24 |
align-items: center; |
| 25 |
background: var(--wppb-fb-surface-default); |
| 26 |
color: var(--wppb-fb-text-muted); |
| 27 |
display: inline-flex; |
| 28 |
font-size: var(--wppb-fb-font-xs); |
| 29 |
font-weight: 600; |
| 30 |
gap: var(--wppb-fb-space-xs); |
| 31 |
left: var(--wppb-fb-space-lg); |
| 32 |
letter-spacing: 0.04em; |
| 33 |
padding: 0 var(--wppb-fb-space-sm); |
| 34 |
position: absolute; |
| 35 |
text-transform: uppercase; |
| 36 |
top: -10px; |
| 37 |
|
| 38 |
svg { |
| 39 |
color: var(--wppb-fb-text-muted); |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
&__hint { |
| 44 |
color: var(--wppb-fb-text-muted); |
| 45 |
font-size: var(--wppb-fb-font-xs); |
| 46 |
font-weight: 500; |
| 47 |
margin: var(--wppb-fb-space-sm) 0 0; |
| 48 |
} |
| 49 |
|
| 50 |
&__row { |
| 51 |
> .block-editor-inner-blocks > .block-editor-block-list__layout { |
| 52 |
display: flex; |
| 53 |
gap: var(--wppb-fb-space-xl); |
| 54 |
// This element IS the InnerBlocks drop zone (data-is-drop-zone). |
| 55 |
// The block uses renderAppender={ () => null }, so when the wrapper |
| 56 |
// is empty the appender contributes no height and the layout |
| 57 |
// collapses to 0px — Gutenberg's drop detection needs a non-zero |
| 58 |
// pointer area, so dropping a field into an EMPTY Columns block was |
| 59 |
// impossible (it only worked once a child gave the layout height). |
| 60 |
// A min-height keeps the empty drop zone targetable; populated rows |
| 61 |
// are always taller, so it's a no-op once fields are inside. |
| 62 |
min-height: 44px; |
| 63 |
|
| 64 |
> .wp-block { |
| 65 |
flex: 1 1 0; |
| 66 |
margin: 0; |
| 67 |
min-width: 0; |
| 68 |
} |
| 69 |
} |
| 70 |
} |
| 71 |
|
| 72 |
// Invalid position (nested / inside a Repeater) — tint muted so the |
| 73 |
// warning Notice reads as the reason the box can't be used here. |
| 74 |
&.is-invalid { |
| 75 |
background: repeating-linear-gradient(135deg, var(--wppb-fb-surface-canvas) 0 8px, #efefef 8px 16px); |
| 76 |
border-color: #b1b1b5; |
| 77 |
} |
| 78 |
} |
| 79 |
|