| 1 |
// Paid Member Subscriptions "Subscription Plans" field — the drag-sortable plan |
| 2 |
// picker in the Field Settings sidebar. Mirrors the classic Manage Fields |
| 3 |
// `.row-subscription-plans .wck-checkboxes` jQuery-UI sortable: one draggable |
| 4 |
// row per plan option (drag handle + include checkbox + label). Drag is |
| 5 |
// initiated from the handle only so the row's checkbox stays clickable; the row |
| 6 |
// is the drop target. Rendered by blocks/field-pms-subscription-plans/edit.js. |
| 7 |
$wppb-pms-handle: 18px; |
| 8 |
$wppb-pms-check: 18px; |
| 9 |
|
| 10 |
.wppb-fb-pms-plans { |
| 11 |
&__row { |
| 12 |
display: flex; |
| 13 |
align-items: center; |
| 14 |
gap: var(--wppb-fb-space-sm); |
| 15 |
padding: var(--wppb-fb-space-2xs) 0; |
| 16 |
border-radius: var(--wppb-fb-radius-sm); |
| 17 |
|
| 18 |
// Insertion indicator while a dragged row hovers this one. |
| 19 |
&.is-drag-over { |
| 20 |
box-shadow: inset 0 2px 0 0 var(--wppb-fb-accent); |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
// Drag handle — the only drag initiator (keeps the checkbox clickable). |
| 25 |
&__handle { |
| 26 |
flex: 0 0 #{$wppb-pms-handle}; |
| 27 |
display: flex; |
| 28 |
align-items: center; |
| 29 |
justify-content: center; |
| 30 |
cursor: grab; |
| 31 |
color: var(--wppb-fb-text-faint); |
| 32 |
|
| 33 |
&:active { cursor: grabbing; } |
| 34 |
|
| 35 |
.dashicons { |
| 36 |
font-size: 16px; |
| 37 |
width: 16px; |
| 38 |
height: 16px; |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
&__check { |
| 43 |
flex: 0 0 #{$wppb-pms-check}; |
| 44 |
margin: 0; |
| 45 |
} |
| 46 |
|
| 47 |
&__label { |
| 48 |
flex: 1 1 auto; |
| 49 |
min-width: 0; |
| 50 |
font-size: var(--wppb-fb-font-sm); |
| 51 |
color: var(--wppb-fb-text-primary); |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
// Canvas preview — mirrors the front-end row shape of |
| 56 |
// pms_output_subscription_plans(): radio + plan name + price/duration + trial + |
| 57 |
// sign-up fee on one line, plan description underneath (the front end's |
| 58 |
// `.pms-subscription-plan-description` is 85% italic, indented past the radio). |
| 59 |
// Rendered with form-builder tokens rather than the theme's, so it reads like the |
| 60 |
// rendered form without pretending to be a pixel preview of it. |
| 61 |
.wppb-fb-pms-plans-preview { |
| 62 |
&__empty { |
| 63 |
color: var(--wppb-fb-text-faint); |
| 64 |
font-size: var(--wppb-fb-font-md); |
| 65 |
} |
| 66 |
} |
| 67 |
|
| 68 |
.wppb-fb-pms-plan { |
| 69 |
// Front end: .pms-subscription-plan { margin-bottom: 18px }. |
| 70 |
&:not(:last-child) { |
| 71 |
margin-bottom: var(--wppb-fb-space-xl); |
| 72 |
} |
| 73 |
|
| 74 |
// The row is a flex line, so the inter-span spacing PMS gets for free from |
| 75 |
// HTML whitespace has to be re-created. The base gap stands in for a single |
| 76 |
// space (price → trial → sign-up fee read as one sentence on the front end); |
| 77 |
// the radio and the price each add a little more, matching the front end's |
| 78 |
// `input { margin-right: 7px }` and the form designs' name/price gap. |
| 79 |
&__row { |
| 80 |
align-items: center; |
| 81 |
display: flex; |
| 82 |
flex-wrap: wrap; |
| 83 |
gap: var(--wppb-fb-space-2xs); |
| 84 |
} |
| 85 |
|
| 86 |
input[type="radio"]="radio""] { |
| 87 |
flex: none; |
| 88 |
margin: 0 var(--wppb-fb-space-2xs) 0 0; |
| 89 |
} |
| 90 |
|
| 91 |
&__name { |
| 92 |
color: var(--wppb-fb-text-primary); |
| 93 |
font-size: var(--wppb-fb-font-md); |
| 94 |
font-weight: 500; |
| 95 |
} |
| 96 |
|
| 97 |
&__price { |
| 98 |
margin-left: var(--wppb-fb-space-2xs); |
| 99 |
} |
| 100 |
|
| 101 |
// Price / duration / trial / sign-up fee all read as secondary detail next to |
| 102 |
// the plan name. Their wording (incl. the " / " duration divider) comes from |
| 103 |
// PMS's own output, so it matches the front end verbatim. |
| 104 |
&__price, |
| 105 |
&__trial, |
| 106 |
&__fee { |
| 107 |
color: var(--wppb-fb-text-muted); |
| 108 |
font-size: var(--wppb-fb-font-md); |
| 109 |
} |
| 110 |
|
| 111 |
&__desc { |
| 112 |
color: var(--wppb-fb-text-muted); |
| 113 |
font-size: var(--wppb-fb-font-sm); |
| 114 |
font-style: italic; |
| 115 |
margin-top: var(--wppb-fb-space-3xs); |
| 116 |
padding-left: var(--wppb-fb-space-2xl); |
| 117 |
} |
| 118 |
|
| 119 |
// A single displayed plan has no radio (front end emits a hidden input), so |
| 120 |
// its description isn't indented either — matching `.pms-hidden`. |
| 121 |
&.is-single &__desc { |
| 122 |
padding-left: 0; |
| 123 |
} |
| 124 |
} |
| 125 |
|