frontblocks-edge-alignment-frontend.js
9 months ago
frontblocks-edge-alignment-option.jsx
2 months ago
frontblocks-edge-alignment-panel.css
1 week ago
frontblocks-edge-alignment.css
1 week ago
frontblocks-edge-alignment.js
2 months ago
frontblocks-edge-alignment.css
119 lines
| 1 | /** |
| 2 | * Container Edge Alignment Styles |
| 3 | * |
| 4 | * Canvas (editor iframe) and frontend styles for edge alignment feature. |
| 5 | * Inspector panel styles live in frontblocks-edge-alignment-panel.css. |
| 6 | */ |
| 7 | |
| 8 | /* =========================== |
| 9 | EDITOR CANVAS STYLES |
| 10 | =========================== */ |
| 11 | |
| 12 | /* Visual feedback in editor */ |
| 13 | .editor-styles-wrapper .frbl-edge-left { |
| 14 | position: relative; |
| 15 | } |
| 16 | |
| 17 | .editor-styles-wrapper .frbl-edge-left::before { |
| 18 | content: ''; |
| 19 | position: absolute; |
| 20 | left: 0; |
| 21 | top: 0; |
| 22 | bottom: 0; |
| 23 | width: 3px; |
| 24 | background: #2271b1; |
| 25 | z-index: 1; |
| 26 | opacity: 0.6; |
| 27 | } |
| 28 | |
| 29 | .editor-styles-wrapper .frbl-edge-right { |
| 30 | position: relative; |
| 31 | } |
| 32 | |
| 33 | .editor-styles-wrapper .frbl-edge-right::after { |
| 34 | content: ''; |
| 35 | position: absolute; |
| 36 | right: 0; |
| 37 | top: 0; |
| 38 | bottom: 0; |
| 39 | width: 3px; |
| 40 | background: #2271b1; |
| 41 | z-index: 1; |
| 42 | opacity: 0.6; |
| 43 | } |
| 44 | |
| 45 | /* =========================== |
| 46 | FRONTEND STYLES |
| 47 | =========================== */ |
| 48 | |
| 49 | /* |
| 50 | * Edge Alignment Styles |
| 51 | * |
| 52 | * The actual margin/width calculations are done via JavaScript |
| 53 | * (see frontblocks-edge-alignment-frontend.js) because CSS variables |
| 54 | * are not available in GeneratePress by default. |
| 55 | * |
| 56 | * JavaScript calculates: |
| 57 | * 1. Original container width (e.g., 1400px) |
| 58 | * 2. Side margin = (100vw - containerWidth) / 2 |
| 59 | * 3. Applies inline styles to fix one side and extend the other |
| 60 | */ |
| 61 | |
| 62 | /* |
| 63 | * Remove LEFT padding - extends to left edge |
| 64 | * (JavaScript will set: marginLeft=0, marginRight=calculated, width=calculated) |
| 65 | */ |
| 66 | .frbl-edge-left { |
| 67 | padding-left: 0 !important; |
| 68 | } |
| 69 | |
| 70 | /* |
| 71 | * Remove RIGHT padding - extends to right edge |
| 72 | * (JavaScript will set: marginRight=0, marginLeft=calculated, width=calculated) |
| 73 | */ |
| 74 | .frbl-edge-right { |
| 75 | padding-right: 0 !important; |
| 76 | } |
| 77 | |
| 78 | /* Ensure child elements respect the edge alignment — GenerateBlocks */ |
| 79 | .frbl-edge-left > .gb-container, |
| 80 | .frbl-edge-left > .gb-grid-wrapper, |
| 81 | .frbl-edge-left > .gb-inside-container { |
| 82 | padding-left: 0 !important; |
| 83 | margin-left: 0 !important; |
| 84 | } |
| 85 | |
| 86 | .frbl-edge-right > .gb-container, |
| 87 | .frbl-edge-right > .gb-grid-wrapper, |
| 88 | .frbl-edge-right > .gb-inside-container { |
| 89 | padding-right: 0 !important; |
| 90 | margin-right: 0 !important; |
| 91 | } |
| 92 | |
| 93 | /* Ensure child elements respect the edge alignment — native core blocks */ |
| 94 | .frbl-edge-left > .wp-block-group__inner-container, |
| 95 | .frbl-edge-left > .wp-block-columns { |
| 96 | padding-left: 0 !important; |
| 97 | margin-left: 0 !important; |
| 98 | } |
| 99 | |
| 100 | .frbl-edge-right > .wp-block-group__inner-container, |
| 101 | .frbl-edge-right > .wp-block-columns { |
| 102 | padding-right: 0 !important; |
| 103 | margin-right: 0 !important; |
| 104 | } |
| 105 | |
| 106 | /* Media query for responsive behavior */ |
| 107 | @media (max-width: 768px) { |
| 108 | /* Keep the edge alignment on mobile by default */ |
| 109 | /* Uncomment below to restore normal padding on mobile if needed */ |
| 110 | /* |
| 111 | .frbl-edge-left, |
| 112 | .frbl-edge-right { |
| 113 | padding-left: var(--gb-spacing-mobile, 20px) !important; |
| 114 | padding-right: var(--gb-spacing-mobile, 20px) !important; |
| 115 | } |
| 116 | */ |
| 117 | } |
| 118 | |
| 119 |