| 1 |
/* ======================================== |
| 2 |
Section Block Styles |
| 3 |
Prefix: bkbg-section |
| 4 |
======================================== */ |
| 5 |
|
| 6 |
/* CSS Custom Properties */ |
| 7 |
.bkbg-section { |
| 8 |
--bkbg-section-max-width: 1200px; |
| 9 |
--bkbg-section-padding-none: 0; |
| 10 |
--bkbg-section-padding-xs: 8px; |
| 11 |
--bkbg-section-padding-s: 16px; |
| 12 |
--bkbg-section-padding-m: 32px; |
| 13 |
--bkbg-section-padding-l: 48px; |
| 14 |
--bkbg-section-padding-xl: 64px; |
| 15 |
--bkbg-section-bg-light: #f8fafc; |
| 16 |
--bkbg-section-bg-dark: #1e293b; |
| 17 |
--bkbg-section-bg-accent: #3b82f6; |
| 18 |
position: relative; |
| 19 |
width: 100%; |
| 20 |
box-sizing: border-box; |
| 21 |
} |
| 22 |
|
| 23 |
/* Content Width (inside section) */ |
| 24 |
.bkbg-section--content-full .bkbg-section__inner { |
| 25 |
width: 100%; |
| 26 |
max-width: 100%; |
| 27 |
padding-left: 20px; |
| 28 |
padding-right: 20px; |
| 29 |
} |
| 30 |
|
| 31 |
.bkbg-section--content-boxed .bkbg-section__inner { |
| 32 |
width: 100%; |
| 33 |
max-width: var(--bkbg-section-max-width); |
| 34 |
margin-left: auto; |
| 35 |
margin-right: auto; |
| 36 |
padding-left: 20px; |
| 37 |
padding-right: 20px; |
| 38 |
box-sizing: border-box; |
| 39 |
} |
| 40 |
|
| 41 |
/* Vertical Padding */ |
| 42 |
.bkbg-section--padding-none { |
| 43 |
padding-top: var(--bkbg-section-padding-none); |
| 44 |
padding-bottom: var(--bkbg-section-padding-none); |
| 45 |
} |
| 46 |
|
| 47 |
.bkbg-section--padding-xs { |
| 48 |
padding-top: var(--bkbg-section-padding-xs); |
| 49 |
padding-bottom: var(--bkbg-section-padding-xs); |
| 50 |
} |
| 51 |
|
| 52 |
.bkbg-section--padding-s { |
| 53 |
padding-top: var(--bkbg-section-padding-s); |
| 54 |
padding-bottom: var(--bkbg-section-padding-s); |
| 55 |
} |
| 56 |
|
| 57 |
.bkbg-section--padding-m { |
| 58 |
padding-top: var(--bkbg-section-padding-m); |
| 59 |
padding-bottom: var(--bkbg-section-padding-m); |
| 60 |
} |
| 61 |
|
| 62 |
.bkbg-section--padding-l { |
| 63 |
padding-top: var(--bkbg-section-padding-l); |
| 64 |
padding-bottom: var(--bkbg-section-padding-l); |
| 65 |
} |
| 66 |
|
| 67 |
.bkbg-section--padding-xl { |
| 68 |
padding-top: var(--bkbg-section-padding-xl); |
| 69 |
padding-bottom: var(--bkbg-section-padding-xl); |
| 70 |
} |
| 71 |
|
| 72 |
/* Background Presets */ |
| 73 |
.bkbg-section--bg-none { |
| 74 |
background-color: transparent; |
| 75 |
} |
| 76 |
|
| 77 |
.bkbg-section--bg-light { |
| 78 |
background-color: var(--bkbg-section-bg-light); |
| 79 |
} |
| 80 |
|
| 81 |
.bkbg-section--bg-dark { |
| 82 |
background-color: var(--bkbg-section-bg-dark); |
| 83 |
color: #ffffff; |
| 84 |
} |
| 85 |
|
| 86 |
.bkbg-section--bg-accent { |
| 87 |
background-color: var(--bkbg-section-bg-accent); |
| 88 |
color: #ffffff; |
| 89 |
} |
| 90 |
|
| 91 |
.bkbg-section--bg-custom { |
| 92 |
background-color: var(--bkbg-section-custom-bg, transparent); |
| 93 |
} |
| 94 |
|
| 95 |
/* Inner wrapper */ |
| 96 |
.bkbg-section__inner { |
| 97 |
display: flex; |
| 98 |
flex-direction: column; |
| 99 |
gap: 24px; |
| 100 |
} |
| 101 |
|
| 102 |
/* ======================================== |
| 103 |
Section Width (outer section) |
| 104 |
======================================== */ |
| 105 |
|
| 106 |
/* Full width - break out of container (frontend) */ |
| 107 |
.bkbg-section.alignfull, |
| 108 |
.bkbg-section--section-full { |
| 109 |
width: 100vw; |
| 110 |
max-width: none; |
| 111 |
position: relative; |
| 112 |
left: 50%; |
| 113 |
transform: translateX(-50%); |
| 114 |
} |
| 115 |
|
| 116 |
/* Support for themes using useRootPaddingAwareAlignments */ |
| 117 |
.has-global-padding > .bkbg-section.alignfull, |
| 118 |
.has-global-padding > .bkbg-section--section-full { |
| 119 |
margin-left: calc(-1 * var(--wp--style--root--padding-left, 0px)) !important; |
| 120 |
margin-right: calc(-1 * var(--wp--style--root--padding-right, 0px)) !important; |
| 121 |
width: calc(100% + var(--wp--style--root--padding-left, 0px) + var(--wp--style--root--padding-right, 0px)) !important; |
| 122 |
max-width: none !important; |
| 123 |
left: auto !important; |
| 124 |
transform: none !important; |
| 125 |
} |
| 126 |
|
| 127 |
/* Wide - centered max width */ |
| 128 |
.bkbg-section.alignwide, |
| 129 |
.bkbg-section--section-wide { |
| 130 |
width: 100%; |
| 131 |
max-width: var(--wp--style--global--wide-size, 1440px); |
| 132 |
margin-left: auto; |
| 133 |
margin-right: auto; |
| 134 |
} |
| 135 |
|
| 136 |
/* Boxed - centered max width */ |
| 137 |
.bkbg-section--section-boxed { |
| 138 |
width: 100%; |
| 139 |
max-width: var(--bkbg-section-section-max-width, var(--bkbg-section-max-width)); |
| 140 |
margin-left: auto; |
| 141 |
margin-right: auto; |
| 142 |
} |
| 143 |
|
| 144 |
/* Ensure theme-level max-width rules don't override Section Width modes */ |
| 145 |
.wp-block-blockenberg-section.bkbg-section--section-boxed { |
| 146 |
max-width: var(--bkbg-section-section-max-width, var(--bkbg-section-max-width)) !important; |
| 147 |
margin-left: auto !important; |
| 148 |
margin-right: auto !important; |
| 149 |
} |
| 150 |
|
| 151 |
.wp-block-blockenberg-section.bkbg-section--section-wide { |
| 152 |
max-width: var(--wp--style--global--wide-size, 1440px) !important; |
| 153 |
margin-left: auto !important; |
| 154 |
margin-right: auto !important; |
| 155 |
} |
| 156 |
|
| 157 |
.wp-block-blockenberg-section.bkbg-section--section-full { |
| 158 |
max-width: none !important; |
| 159 |
width: 100vw !important; |
| 160 |
position: relative; |
| 161 |
left: 50%; |
| 162 |
transform: translateX(-50%); |
| 163 |
} |
| 164 |
|
| 165 |
/* Editor-specific styles */ |
| 166 |
.editor-styles-wrapper .bkbg-section { |
| 167 |
min-height: 60px; |
| 168 |
border: 1px dashed transparent; |
| 169 |
transition: border-color 0.15s ease, box-shadow 0.15s ease; |
| 170 |
} |
| 171 |
|
| 172 |
.editor-styles-wrapper .bkbg-section:hover { |
| 173 |
border-color: rgba(59, 130, 246, 0.3); |
| 174 |
} |
| 175 |
|
| 176 |
.editor-styles-wrapper .bkbg-section.is-selected, |
| 177 |
.editor-styles-wrapper .bkbg-section:focus-within { |
| 178 |
border-color: rgba(59, 130, 246, 0.5); |
| 179 |
} |
| 180 |
|
| 181 |
/* Drag and drop state */ |
| 182 |
.editor-styles-wrapper .bkbg-section.is-dragging-over, |
| 183 |
.editor-styles-wrapper [data-type="blockenberg/section"].is-dragging-over > .bkbg-section { |
| 184 |
border-color: rgba(59, 130, 246, 0.6) !important; |
| 185 |
background-color: rgba(59, 130, 246, 0.03) !important; |
| 186 |
} |
| 187 |
|
| 188 |
/* Ensure InnerBlocks placeholder shows correctly - direct children only */ |
| 189 |
.editor-styles-wrapper .bkbg-section > .bkbg-section__inner > .block-editor-inner-blocks { |
| 190 |
width: 100%; |
| 191 |
} |
| 192 |
|
| 193 |
.editor-styles-wrapper .bkbg-section > .bkbg-section__inner > .block-editor-inner-blocks > .block-editor-block-list__layout { |
| 194 |
width: 100%; |
| 195 |
display: flex; |
| 196 |
flex-direction: column; |
| 197 |
gap: 24px; |
| 198 |
} |
| 199 |
|
| 200 |
/* Section label in editor */ |
| 201 |
.editor-styles-wrapper .bkbg-section::before { |
| 202 |
content: 'Section'; |
| 203 |
position: absolute; |
| 204 |
top: -20px; |
| 205 |
left: 0; |
| 206 |
font-size: 10px; |
| 207 |
font-weight: 600; |
| 208 |
color: #3b82f6; |
| 209 |
text-transform: uppercase; |
| 210 |
letter-spacing: 0.5px; |
| 211 |
opacity: 0; |
| 212 |
transition: opacity 0.15s ease; |
| 213 |
pointer-events: none; |
| 214 |
} |
| 215 |
|
| 216 |
.editor-styles-wrapper .bkbg-section:hover::before, |
| 217 |
.editor-styles-wrapper .bkbg-section.is-selected::before { |
| 218 |
opacity: 1; |
| 219 |
} |
| 220 |
|
| 221 |
/* (Alignment rules moved above; keep nested overrides below) */ |
| 222 |
|
| 223 |
/* Nested sections inside columns should be full width of column */ |
| 224 |
.bkbg-column .bkbg-section, |
| 225 |
.bkbg-column .bkbg-section.alignfull, |
| 226 |
.bkbg-column .bkbg-section.alignwide, |
| 227 |
.bkbg-column .bkbg-section--section-full, |
| 228 |
.bkbg-column .bkbg-section--section-wide, |
| 229 |
.bkbg-column .bkbg-section--section-boxed { |
| 230 |
width: 100% !important; |
| 231 |
max-width: 100% !important; |
| 232 |
margin-left: 0 !important; |
| 233 |
margin-right: 0 !important; |
| 234 |
} |
| 235 |
|
| 236 |
/* Editor: use margin-based breakout instead of transform (better for editor UI) */ |
| 237 |
.editor-styles-wrapper .bkbg-section--section-full { |
| 238 |
width: auto !important; |
| 239 |
max-width: none !important; |
| 240 |
|
| 241 |
/* Break out of the content area */ |
| 242 |
margin-left: calc(50% - 50vw) !important; |
| 243 |
margin-right: calc(50% - 50vw) !important; |
| 244 |
|
| 245 |
/* Reset frontend transform/left centering */ |
| 246 |
left: auto !important; |
| 247 |
transform: none !important; |
| 248 |
} |
| 249 |
|
| 250 |
.editor-styles-wrapper .bkbg-section--section-wide { |
| 251 |
width: 100% !important; |
| 252 |
max-width: var(--wp--style--global--wide-size, 1440px) !important; |
| 253 |
margin-left: auto !important; |
| 254 |
margin-right: auto !important; |
| 255 |
} |
| 256 |
|
| 257 |
.editor-styles-wrapper .bkbg-section--section-boxed { |
| 258 |
width: 100% !important; |
| 259 |
max-width: var(--bkbg-section-section-max-width, var(--bkbg-section-max-width)) !important; |
| 260 |
margin-left: auto !important; |
| 261 |
margin-right: auto !important; |
| 262 |
} |
| 263 |
|
| 264 |
/* Editor: override generic .wp-block max-width constraints for this block */ |
| 265 |
.editor-styles-wrapper .wp-block[data-type="blockenberg/section"].bkbg-section--section-boxed { |
| 266 |
max-width: var(--bkbg-section-section-max-width, var(--bkbg-section-max-width)) !important; |
| 267 |
margin-left: auto !important; |
| 268 |
margin-right: auto !important; |
| 269 |
} |
| 270 |
|
| 271 |
.editor-styles-wrapper .wp-block[data-type="blockenberg/section"].bkbg-section--section-wide { |
| 272 |
max-width: var(--wp--style--global--wide-size, 1440px) !important; |
| 273 |
margin-left: auto !important; |
| 274 |
margin-right: auto !important; |
| 275 |
} |
| 276 |
|
| 277 |
.editor-styles-wrapper .wp-block[data-type="blockenberg/section"].bkbg-section--section-full { |
| 278 |
max-width: none !important; |
| 279 |
width: auto !important; |
| 280 |
/* Use margin breakout */ |
| 281 |
margin-left: calc(50% - 50vw) !important; |
| 282 |
margin-right: calc(50% - 50vw) !important; |
| 283 |
left: auto !important; |
| 284 |
transform: none !important; |
| 285 |
} |
| 286 |
|
| 287 |
/* Responsive adjustments */ |
| 288 |
@media (max-width: 782px) { |
| 289 |
.bkbg-section--content-boxed .bkbg-section__inner, |
| 290 |
.bkbg-section--content-full .bkbg-section__inner { |
| 291 |
padding-left: 16px; |
| 292 |
padding-right: 16px; |
| 293 |
} |
| 294 |
|
| 295 |
.bkbg-section--padding-l { |
| 296 |
padding-top: 32px; |
| 297 |
padding-bottom: 32px; |
| 298 |
} |
| 299 |
|
| 300 |
.bkbg-section--padding-xl { |
| 301 |
padding-top: 48px; |
| 302 |
padding-bottom: 48px; |
| 303 |
} |
| 304 |
} |
| 305 |
|
| 306 |
/* Inspector: spacing controls */ |
| 307 |
.block-editor-page .bkbg-spacing-control, |
| 308 |
.interface-interface-skeleton__editor .bkbg-spacing-control { |
| 309 |
margin-top: 12px; |
| 310 |
padding-top: 10px; |
| 311 |
border-top: 1px solid #e2e8f0; |
| 312 |
} |
| 313 |
|
| 314 |
.block-editor-page .bkbg-spacing-control__title, |
| 315 |
.interface-interface-skeleton__editor .bkbg-spacing-control__title { |
| 316 |
font-size: 13px; |
| 317 |
font-weight: 600; |
| 318 |
color: #1f2937; |
| 319 |
margin-bottom: 10px; |
| 320 |
} |
| 321 |
|
| 322 |
.block-editor-page .bkbg-spacing-control__grid, |
| 323 |
.interface-interface-skeleton__editor .bkbg-spacing-control__grid { |
| 324 |
display: grid; |
| 325 |
grid-template-columns: repeat(2, minmax(0, 1fr)); |
| 326 |
gap: 10px 12px; |
| 327 |
} |
| 328 |
|
| 329 |
.block-editor-page .bkbg-spacing-control__item, |
| 330 |
.interface-interface-skeleton__editor .bkbg-spacing-control__item { |
| 331 |
min-width: 0; |
| 332 |
} |
| 333 |
|
| 334 |
.block-editor-page .bkbg-spacing-control__label, |
| 335 |
.interface-interface-skeleton__editor .bkbg-spacing-control__label { |
| 336 |
display: block; |
| 337 |
font-size: 12px; |
| 338 |
font-weight: 500; |
| 339 |
color: #374151; |
| 340 |
margin-bottom: 4px; |
| 341 |
} |
| 342 |
|
| 343 |
.block-editor-page .bkbg-spacing-control__row, |
| 344 |
.interface-interface-skeleton__editor .bkbg-spacing-control__row { |
| 345 |
display: grid; |
| 346 |
grid-template-columns: minmax(0, 1fr) 78px; |
| 347 |
gap: 6px; |
| 348 |
align-items: center; |
| 349 |
} |
| 350 |
|
| 351 |
.block-editor-page .bkbg-spacing-control__custom-unit, |
| 352 |
.interface-interface-skeleton__editor .bkbg-spacing-control__custom-unit { |
| 353 |
margin-top: 6px; |
| 354 |
} |
| 355 |
|