bricks_auto_responsive

Phase 5IntermediateComplexity: 5/10
Auto-apply responsive rules to a page

Overview

Automatically analyzes the element structure of a page (or a specific section) and applies sensible responsive overrides based on the chosen strategy. This tool scans for multi-column grids, large font sizes, excessive padding, horizontal flex layouts, and fixed widths, then applies appropriate breakpoint overrides to make the page work well on tablets and mobile devices.

This is the « one-click » responsive solution for Phase 5 polish. It handles the most common responsive patterns automatically, saving significant time compared to manually setting breakpoint overrides on every element with bricks_set_responsive_settings.

Key Features

Two Strategies
Conservative mode applies only safe, predictable changes (grid collapse, font reduction, padding reduction, flex stacking). Aggressive mode additionally hides decorative elements, collapses complex layouts, and adjusts all spacing.
Intelligent Element Scanning
Analyzes the actual CSS properties of every element to determine what needs responsive overrides: multi-column grids, large font sizes, excessive padding, horizontal flex layouts, and fixed widths.
Section-Level Targeting
Optionally target a specific section by its element ID, leaving other sections untouched. This is useful when only one section needs responsive adjustments.
Change Report
Returns a detailed report of all changes made, including which elements were modified, what settings were added, and which breakpoints were targeted.

When to Use

During Phase 5 (polish and audit) to ensure all pages are responsive
After building page content when you want a quick responsive baseline
When a page has many grid and flex layouts that need mobile overrides
To apply consistent responsive rules across all sections of a page
Prerequisites
Page must have content (elements) to analyze
Page content should be finalized before running auto-responsive
For section-specific targeting, you need the section element ID

When NOT to Use

When you need precise control over specific breakpoint overrides — use bricks_set_responsive_settings
If the page already has carefully tuned responsive settings that should not be overwritten
For templates (headers/footers) — these should be made responsive manually during Phase 3

Parameters

3 Total Parameters2 Required1 Optional
page_idnumberREQUIRED
The WordPress page (post) ID to apply responsive rules to.
section_idstringoptional
Specific section element ID to make responsive. If omitted, the entire page is processed.
strategystringREQUIRED
Responsive strategy to apply. "conservative" applies only safe, predictable changes. "aggressive" makes more sweeping adjustments including hiding decorative elements.
Values: conservative, aggressive

Code Examples


Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12

Apply conservative responsive rules to entire page

Run auto-responsive on the whole page during Phase 5 polish to ensure grids collapse, text scales, and padding reduces on mobile devices.

JSON
// Apply to entire page
bricks_auto_responsive({
  page_id: 42,
  strategy: "conservative"
})
// Returns: { success: true, changes: [...], summary: {
//   elements_modified: 12,
//   overrides_applied: 28,
//   by_breakpoint: { tablet_portrait: 10, mobile_portrait: 18 }
// } }

Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12

Target a specific section with aggressive strategy

Apply aggressive responsive adjustments to a complex hero section that has many decorative elements and large font sizes.

JSON
bricks_auto_responsive({
  page_id: 42,
  section_id: "hero01",
  strategy: "aggressive"
})

Common Mistakes


Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1939

Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48

Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
If you add more sections after running auto-responsive, those new sections will not have responsive overrides. Run auto-responsive as one of the last steps in your build workflow.

Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 1939

Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48

Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Auto-responsive may overwrite manually tuned breakpoint overrides. If you have custom responsive settings on specific elements, use section-level targeting to avoid affecting them.

Tips & Warnings

Tips & Warnings

Recommended workflow: Build the full page content first, then run bricks_auto_responsive({ strategy: "conservative" }) once as a Phase 5 polish step. Review the change report and use bricks_set_responsive_settings for any fine-tuning needed.

Conservative vs aggressive: Start with conservative. It covers the most impactful changes (grid collapse, font scaling, padding reduction) without any surprises. Only use aggressive if the page has many decorative elements that should be hidden on mobile.

Return Values

FieldTypeDescription
successbooleanWhether the auto-responsive rules were successfully applied.
changesarrayArray of change objects detailing each responsive override applied, including element_id, breakpoint, setting_key, and new value.
summaryobjectSummary of changes: total elements modified, total overrides applied, and breakdown by breakpoint and change type.

Related Tools

Technical Details

Tool ID
bricks_auto_responsive
API Endpoint
/bricks-mcp/v1/pages/{page_id}/auto-responsive
HTTP Method
POST
Namespace
pages-elements
Source File
pages/responsive.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release with conservative and aggressive strategies, section-level targeting, and change reporting.
20250101