bricks_update_theme_styles
Overview
Updates a theme style’s settings in Bricks Builder using deep merge — only the provided sections are changed, leaving all other settings intact. This is the primary tool for configuring site-wide typography, heading scale, heading margins, link styles, contextual spacing, and element defaults.
This tool is critical in Phase 2 (Design System Setup) and must configure the complete typography scale (H1-H6), heading margins, body typography, link styles, contextual spacing, and element defaults for sections, containers, and buttons.
Settings are organized into sections: typography, colors, general, links, contextualSpacing, css, and element-specific sections (section, container, button, heading, etc.).
Key Features
When to Use
Configuring heading margins (h1Margin through h6Margin) for vertical rhythm
Setting body typography (font-family, font-size, color, line-height)
Configuring link styles (color, text-decoration, transition)
Setting contextual spacing to remove default margins and add consistent paragraph/heading spacing
Setting element defaults for sections (padding), containers (max-width), and buttons (padding, border-radius)
Color palette should be set up first so variables like var(--bricks-color-primary) resolve correctly
Spacing variables should be created before referencing them in theme style settings
When NOT to Use
When changing colors (use bricks_create_color or bricks_create_color_palette instead)
When setting per-element styles on a specific page (use global classes or inline settings)
Parameters
style_idstringREQUIREDlabelstringoptionalsettingsobjectREQUIREDconditionsarrayoptionalCode Examples
Complete Phase 2 theme style setup
Comprehensive example from CLAUDE.md Phase 2 step 5 showing body typography, full H1-H6 scale, heading margins, link styles, contextual spacing, and element defaults. This is the recommended starting configuration for every new site.
{
"style_id": "default",
"settings": {
"typography": {
"typographyBody": {
"font-family": "Inter",
"font-size": "16px",
"line-height": "1.6",
"color": { "hex": "#333333" }
},
"typographyHeadings": {
"font-family": "Inter"
},
"typographyHeadingH1": {
"font-size": "52px",
"font-weight": "700",
"line-height": "1.15"
},
"typographyHeadingH2": {
"font-size": "40px",
"font-weight": "600",
"line-height": "1.2"
},
"typographyHeadingH3": {
"font-size": "30px",
"font-weight": "600",
"line-height": "1.3"
},
"typographyHeadingH4": {
"font-size": "24px",
"font-weight": "600",
"line-height": "1.35"
},
"typographyHeadingH5": {
"font-size": "20px",
"font-weight": "600",
"line-height": "1.4"
},
"typographyHeadingH6": {
"font-size": "16px",
"font-weight": "600",
"line-height": "1.5"
},
"h1Margin": { "bottom": "24" },
"h2Margin": { "top": "48", "bottom": "20" },
"h3Margin": { "top": "32", "bottom": "16" },
"h4Margin": { "top": "24", "bottom": "12" },
"h5Margin": { "top": "20", "bottom": "8" },
"h6Margin": { "top": "16", "bottom": "8" }
},
"links": {
"typography": {
"color": { "raw": "var(--bricks-color-primary)" },
"text-decoration": "none"
},
"transition": "all 0.3s ease"
},
"contextualSpacing": {
"contextualSpacingRemoveDefaultMargins": [
"h1", "h2", "h3", "h4", "h5", "h6", "p", "ul", "ol"
],
"contextualSpacingParagraph": { "bottom": "16" },
"contextualSpacingHeading": { "top": "32", "bottom": "12" }
},
"section": {
"_padding": { "top": "80", "bottom": "80" }
},
"container": {
"_width": "1200px"
},
"button": {
"_padding": {
"top": "12",
"right": "24",
"bottom": "12",
"left": "24"
},
"_border": {
"radius": { "top": "8", "right": "8", "bottom": "8", "left": "8" }
},
"_typography": { "font-weight": "600" }
}
}
}{
"success": true,
"style_id": "default",
"message": "Theme style updated. Sections modified: typography, links, contextualSpacing, section, container, button."
}Update only link styles
Deep merge means you can update a single section without affecting everything else.
{
"style_id": "default",
"settings": {
"links": {
"typography": {
"color": { "hex": "#4361ee" },
"text-decoration": "underline"
},
"transition": "color 0.2s ease"
}
}
}{
"success": true,
"style_id": "default",
"message": "Theme style updated. Sections modified: links."
}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
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
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
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
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
Tips & Warnings
Critical: This is the most important design system tool. A well-configured theme style eliminates the need for inline typography and spacing on individual elements. Always set the complete H1-H6 scale, heading margins, and contextual spacing.
Tip: Deep merge means you can call this tool multiple times to build up settings incrementally. Each call only modifies the sections you provide.
Tip: Typography settings use CSS property names with hyphens: font-size, font-weight, line-height. Colors use the object format: { "hex": "#333" } or { "raw": "var(--bricks-color-primary)" }.
Warning: Conditions are fully replaced (not merged) when the conditions parameter is provided. If you only want to update settings without changing conditions, omit the conditions parameter entirely.