bricks_regenerate_assets

Phase 5BeginnerComplexity: 3/10
Rebuild all Bricks CSS files

Overview

Regenerates all Bricks CSS asset files. This is essential after any design system changes including color palette updates, global class modifications, variable changes, theme style updates, or custom CSS additions. Without regeneration, frontend rendering may not reflect the latest changes.

You can scope the regeneration to specific areas (pages, theme_styles, global_classes, colors, variables, custom_css) or regenerate everything at once with scope « all ».

Key Features

Scoped Regeneration
Target specific areas like theme_styles, global_classes, colors, variables, or custom_css instead of regenerating everything.
Full Rebuild
Scope "all" regenerates every CSS file including page-level styles, ensuring complete consistency.
Static File Generation
When CSS loading is set to "file" mode, this tool rebuilds the physical CSS files served to visitors.

When to Use

After creating or updating colors in the palette
After creating, updating, or deleting global classes
After modifying global CSS variables
After changing theme styles (typography, element defaults)
After adding or modifying custom CSS
After updating site settings that affect CSS output
Prerequisites
At least one design system change that needs to be reflected on the frontend

When NOT to Use

After content-only changes (text, images, links) that do not affect CSS
Immediately after each individual change in a batch — wait until the batch is complete, then regenerate once

Parameters

1 Total Parameters1 Optional
scopestringoptional
What to regenerate. Use "all" for a complete rebuild or target a specific area.
Default: all Values: all, pages, theme_styles, global_classes, colors, variables, custom_css

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

Full Asset Regeneration

Regenerates all CSS files. Recommended after completing a batch of design system changes.

JSON
bricks_regenerate_assets({ scope: "all" })

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

Regenerate Only Classes

Faster targeted regeneration after only modifying global classes.

JSON
bricks_regenerate_assets({ scope: "global_classes" })

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 2018

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
During Phase 2 when creating multiple colors, classes, and variables, wait until the batch is complete. Regenerate once at the end instead of after each individual operation to save time.

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 2018

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 update colors, classes, or variables but skip regeneration, the frontend will show stale CSS. Always regenerate after completing design system modifications.

Tips & Warnings

Tips & Warnings

Batch efficiency: When making multiple design system changes (Phase 2), perform all changes first, then call bricks_regenerate_assets once with scope « all » at the end. This is much faster than regenerating after each change.

CSS loading mode: Regeneration is especially important when cssLoading is set to « file » mode, as physical CSS files need to be rebuilt on disk.

Return Values

FieldTypeDescription
successbooleanWhether regeneration completed successfully
scopestringThe scope that was regenerated
messagestringConfirmation message with details

Related Tools

Technical Details

Tool ID
bricks_regenerate_assets
API Endpoint
/site-settings/regenerate-assets
HTTP Method
POST
Namespace
wordpress-site
Source File
wordpress/site-settings.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release
20250101