bricks_delete_variable_category
Overview
Deletes a global variable category by ID. Variables that belonged to the deleted category become uncategorized — they are NOT deleted, only their category assignment is removed. The variables themselves remain fully functional.
This is useful for cleaning up unused or duplicate categories during a design system reorganization. The variables continue to work as CSS custom properties; they simply lose their grouping in the Bricks builder UI.
Key Features
When to Use
Reorganizing the category structure — delete old categories after moving variables to new ones
Cleaning up categories left behind after deleting all their variables
When NOT to Use
When you want to move variables to a different category — use bricks_update_global_variable to reassign the category first
Parameters
category_idstringREQUIREDCode Examples
Delete an Unused Category
Remove a category that is no longer needed. Its variables become uncategorized.
// Step 1: List categories
bricks_get_variable_categories({})
// Returns: [{ id: "cat_old", name: "Legacy Tokens" }, { id: "cat_new", name: "Spacing" }]
// Step 2: Delete the legacy category
bricks_delete_variable_category({
category_id: "cat_old"
}){"success": true, "message": "Category deleted. Variables in this category are now uncategorized."}Reorganize Categories
Move variables to a new category, then delete the old one.
// Step 1: Move variables from old category to new
bricks_update_global_variable({ variable_id: "v1", category: "Design Tokens" })
bricks_update_global_variable({ variable_id: "v2", category: "Design Tokens" })
// Step 2: Delete the now-empty old category
bricks_delete_variable_category({ category_id: "cat_old" }){"success": true, "message": "Category deleted. Variables in this category are now uncategorized."}Common Mistakes
// Thinking this deletes the spacing variables too
bricks_delete_variable_category({ category_id: "cat_spacing" })
// Variables still exist! They are just uncategorized now.// To delete variables AND category:
// First delete each variable
bricks_delete_global_variable({ variable_id: "v1" })
bricks_delete_global_variable({ variable_id: "v2" })
// Then delete the empty category
bricks_delete_variable_category({ category_id: "cat_spacing" })bricks_delete_variable_category({ category_id: "cat_spacing" })
// 9 spacing variables are now scattered as uncategorized!// Keep the category or create a replacement before deleting
bricks_create_variable_category({ name: "Spacing Scale" })
// Move variables, then delete old categoryTips & Warnings
Variables are preserved: Deleting a category never deletes its variables. They become uncategorized and continue functioning normally.
Reorganize before deleting: If you want to move variables to a new category, use bricks_update_global_variable to reassign each variable before deleting the old category.
Standard categories: Avoid deleting core categories like « Spacing », « Colors », or « Typography » unless you are deliberately restructuring the design system.