bricks_create_variable_category
Overview
Creates a new category for organizing global CSS variables in the Bricks builder UI. Categories group related design tokens together (e.g., « Spacing », « Colors », « Typography ») for easier management and discovery.
Note that categories are also auto-created when you specify a category name in bricks_create_global_variable or bricks_create_variables_batch. This tool is primarily useful when you want to create categories with optional scale configurations (Bricks 2.2+) before adding variables.
Key Features
When to Use
Setting up the category structure during Phase 2 of a website build
Creating categories that need specific scale properties for Style Manager CSS generation
Organizing variables when you want explicit control over category creation
When NOT to Use
When you just need to list existing categories — use bricks_get_variable_categories
Parameters
namestringREQUIREDscaleobjectoptionalCode Examples
Create a Spacing Category
Create a category for organizing spacing design tokens.
bricks_create_variable_category({
name: "Spacing"
}){"success": true, "data": {"id": "cat_abc123", "name": "Spacing"}}Create a Category with Scale (Bricks 2.2+)
Create a category with scale configuration for Style Manager CSS generation.
bricks_create_variable_category({
name: "Spacing",
scale: { "type": "linear", "steps": 9 }
}){"success": true, "data": {"id": "cat_abc123", "name": "Spacing", "scale": {"type": "linear", "steps": 9}}}Common Mistakes
// Unnecessary: creating the category manually first
bricks_create_variable_category({ name: "Spacing" })
bricks_create_variables_batch({
variables: [{ name: "spacing-xs", value: "4px", category: "Spacing" }]
})// Category is auto-created — no separate call needed
bricks_create_variables_batch({
variables: [{ name: "spacing-xs", value: "4px", category: "Spacing" }]
})Tips & Warnings
Auto-creation is usually sufficient: Categories are automatically created when you specify a category name in bricks_create_global_variable or bricks_create_variables_batch. Only use this tool when you need to set scale configurations.
Standard categories: « Spacing », « Colors », « Typography », « Sizing », « Borders », « Shadows » are the most common organizational groupings.
Scale property (Bricks 2.2+): The scale configuration controls how variables in this category interact with the Style Manager CSS file. Consult Bricks documentation for available scale types.