=== Responsive Columns === Contributors: specia1ne Donate link: https://specia1ne.com Tags: gutenberg, block-editor, columns, responsive, css-grid Requires at least: 6.4 Tested up to: 6.9 Requires PHP: 7.4 Stable tag: 1.2.0 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html Adaptive column counts, gap controls, and Masonry layouts for core Columns and Query Loop blocks. No custom blocks required. == Description == Responsive Columns extends the core Columns block and the Query Loop grid template with precise controls for four breakpoints, X/Y gap management, and an optional Masonry layout. ### Key features * Four responsive breakpoints for tablet and mobile layouts. * Theme-aware gaps with separate column and row spacing controls. * One-click Masonry for Query Loop grids. * Native block support for core/Columns and core/Post Template. * Lightweight output based on CSS custom properties and small front-end assets. ### How it works The plugin adds a `has-s1-rc-columns` class and a small set of CSS custom properties: --s1-rc-columns-mobile-portrait --s1-rc-columns-mobile-landscape --s1-rc-columns-tablet-portrait --s1-rc-columns-tablet-landscape --s1-rc-columns-desktop --s1-rc-gap-x --s1-rc-gap-y Your theme stays in control of the base layout. Responsive Columns only adjusts the number of columns and gaps at the configured breakpoints. If the plugin is removed, the blocks fall back to their normal WordPress behavior without leaving custom block markup behind. ### Editor experience * Responsive controls live inside the block inspector. * Gap defaults are pulled from the active theme when possible. * Masonry availability is validated before it can be enabled. * Reset restores responsive values back to the active theme defaults. ### Accessibility and localization * Inspector controls are keyboard accessible and labeled for screen readers. * Strings are translation-ready via the `responsive-columns` text domain. == Installation == 1. Upload the plugin folder to `/wp-content/plugins/` or install Responsive Columns from the WordPress plugin directory. 2. Activate the plugin. 3. Select a Columns block or a Query Loop using the grid layout, then open the **Responsive Columns** panel in the sidebar. == Frequently Asked Questions == = Does it work with reusable blocks and patterns? = Yes. Settings are stored as native block attributes, so they remain with reusable blocks, synced patterns, and template parts. = Will layouts break if I uninstall the plugin? = No. WordPress ignores the extra attributes after the plugin is removed, so content falls back to the default responsive behavior. = Does it depend on a specific theme? = No. The plugin extends native core blocks and keeps the active theme in charge of layout styles and spacing tokens. == Screenshots == 1. Responsive Columns panel for the core Columns block. 2. Query Loop grid with tablet and mobile column controls. 3. Masonry toggle with inline validation guidance. == Changelog == = 1.2.0 = * Hardened front-end gap sanitization with safer CSS value validation. * Improved theme gap detection for `theme.json` preset and custom CSS variable formats. * Fixed editor preview selectors so responsive styles target only supported blocks. * Improved Masonry stability during image loading, resize events, and dynamic content updates. * Registered shared front-end styles per supported block instead of loading them globally. * Cleaned up project metadata for ongoing maintenance and future releases. = 1.1.1 = * Reset responsive settings now restores gap values directly from the active theme. * New blocks initialize with the correct default gap from the theme or a reliable fallback (`24px`). * Column and row gaps stay synchronized consistently when linked. * Editor controls now display real pixel values based on the theme rather than placeholders. * Added a validation layer that only enables Masonry for valid Query Loop grid layouts. = 1.1.0 = * Reworked the HTML filter to use `WP_HTML_Tag_Processor` instead of regex. * Hardened asset loading by reading script dependencies from `index.asset.php` with graceful fallbacks. * Optimized Masonry with clamped gap values, rate-limited resize handling, and observer cleanup. * Improved accessibility text for gap sliders and Masonry controls. = 1.0.0 = * Initial public release. == Upgrade Notice == = 1.2.0 = This update improves reliability across themes and stabilizes Masonry and editor preview behavior without changing the plugin's scope.