bricks_delete_color
Phase 2BeginnerDestructiveComplexity: 2/10
Remove a color from the palette
Overview
Deletes a color from the Bricks color palette. This permanently removes the color entry, its CSS variable, and any associated utility classes. Elements referencing the deleted color’s CSS variable will lose their color styling.
Key Features
Permanent deletion
Removes the color, its CSS variable, and utility classes from the palette
When to Use
Removing unused colors from the palette
Cleaning up duplicate or incorrect color entries
Part of a palette restructuring workflow
Cleaning up duplicate or incorrect color entries
Part of a palette restructuring workflow
Prerequisites
Get the color_id from bricks_get_color_palette
Verify the color is not actively used in elements or global classes
Verify the color is not actively used in elements or global classes
When NOT to Use
If the color is actively used in elements or classes — check usage first
To modify a color — use bricks_update_color instead
To modify a color — use bricks_update_color instead
Parameters
1 Total Parameters1 Required
color_idstringREQUIREDID of the color to delete
Code Examples
Delete a color
Remove a color by its ID
JSON
{
"color_id": "abc123"
}Response
{"success": true}Common Mistakes
Deleting a color that is referenced by elements or global classes
Check color usage via bricks_get_color_palette and search for var(--bricks-color-{name}) references before deleting
Tips & Warnings
Tips & Warnings
- This action is permanent — there is no undo
- Elements using
var(--bricks-color-{name})will lose their color after deletion - Consider using
bricks_update_colorto change a color rather than deleting and recreating
Return Values
Related Tools
Technical Details
Changelog
v1.0
Initial release
20250101