| @@ -73,9 +73,10 @@ | ||
| 73 | 73 | $CSS = ''; |
| 74 | 74 | |
| 75 | 75 | // CSS Fixes |
| 76 | 76 | if ( 'blocks' === $layout ) { |
| 77 | - if ( in_array( $args['style'], array( 'default', '1', '2', '4' ) ) ) { | |
| 77 | + // styles with a floating label above the block (5 and 7 are card styles like the default) | |
| 78 | + if ( in_array( $args['style'], array( 'default', '1', '2', '4', '5', '7' ) ) ) { | |
| 78 | 79 | $CSS .= "#{$args['id']} { gap: 20px 10px }"; |
| 79 | 80 | $CSS .= "#{$args['id']} .tiered-pricing-block { position: relative; }"; |
| 80 | 81 | $CSS .= "#{$args['id']} .tiered-pricing-tier-label {margin: 0 !important; |
| 81 | 82 | position: absolute; |
| @@ -85,9 +86,9 @@ | ||
| 85 | 86 | text-transform: uppercase; |
| 86 | 87 | z-index: 20;}"; |
| 87 | 88 | } |
| 88 | 89 | |
| 89 | - if ( in_array( $args['style'], array( 'default', '2', '4' ) ) ) { | |
| 90 | + if ( in_array( $args['style'], array( 'default', '2', '4', '5', '7' ) ) ) { | |
| 90 | 91 | $CSS .= "#{$args['id']} .tiered-pricing-block:has(#" . $label->getId() . ") { padding-top: 12px; }"; |
| 91 | 92 | } |
| 92 | 93 | |
| 93 | 94 | if ( $args['style'] === '1' ) { |
| @@ -96,9 +97,11 @@ | ||
| 96 | 97 | } |
| 97 | 98 | } elseif ( 'table' === $layout ) { |
| 98 | 99 | $CSS .= "#{$args['id']} tbody td:has(#" . $label->getId() . ") { display: flex; align-items: center; gap: 5px; }"; |
| 99 | 100 | } elseif ( 'plain-text' === $layout ) { |
| 100 | - $CSS .= ".tiered-pricing-plain-text:has(#" . $label->getId() . ") {display:flex; align-items: center; gap: 5px; }"; | |
| 101 | + // the "one line" style keeps its tiers inline | |
| 102 | + $display = '2' === (string) $args['style'] ? 'inline-flex' : 'flex'; | |
| 103 | + $CSS .= "#{$args['id']} .tiered-pricing-plain-text:has(#" . $label->getId() . ") { display: {$display}; align-items: center; gap: 5px; }"; | |
| 101 | 104 | } |
| 102 | 105 | |
| 103 | 106 | if ( $CSS ) { |
| 104 | 107 | ?> |