# DUPLICATE: MCP: saving one element rewrites the custom CSS of every element in the post

**URL:** <https://forum.bricksbuilder.io/t/duplicate-mcp-saving-one-element-rewrites-the-custom-css-of-every-element-in-the-post/40702>\
**Category:** Bugs\
**Tags:** v2-4-3\
**Created:** [October 27, 2026, 1:00am UTC](https://forum.bricksbuilder.io/t/duplicate-mcp-saving-one-element-rewrites-the-custom-css-of-every-element-in-the-post/40702 "2026-10-27T01:00:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonaswd](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@jonaswd](https://forum.bricksbuilder.io/u/jonaswd)\
**Post date:** [October 27, 2026, 1:00am UTC](https://forum.bricksbuilder.io/t/duplicate-mcp-saving-one-element-rewrites-the-custom-css-of-every-element-in-the-post/40702/1 "2026-10-27T01:00:41Z")

</div>

**Environment:** Bricks 2.4.3 · Bricks Abilities 2.0.0 · MCP Adapter 0.7.1

This Report is formulated by Claude because claude encountered this issue.

### Steps to reproduce

1. Page with several elements whose Custom CSS contains comments and an `@media` block at the end.
2. Use `bricks/update-element` to change one unrelated setting on a different element (e.g. `_gridTemplateColumns`).
3. Open the Custom CSS of the other elements.

### Expected

Only the targeted setting changes. All other CSS stays as written.

### Actual

The Custom CSS of **all elements in the post** is rewritten:

- Comments are removed.
- `@media` / `@container` blocks are moved **before** the regular rules.
- Grouped selectors (`a, b {}`) are split into separate rules.
- Simple root declarations (`#brxe-xyz { display: grid; … }`) are moved into element settings.

`bricks/update-global-class` behaves the same for the class’s CSS. `bricks/set-page-settings` (page CSS) is not affected.

### Why it breaks layouts

Moving `@media` blocks to the top changes the cascade. A base rule with the same selector now comes later and wins:

```css
/* before */
.table tr { grid-template-columns: 1fr 6rem 16rem; }
@media (max-width: 767px) { .table tr { grid-template-columns: 1fr; } }

/* after save via MCP */
@media (max-width: 767px) { .table tr { grid-template-columns: 1fr; } }
.table tr { grid-template-columns: 1fr 6rem 16rem; } /* always wins */

```

Result: responsive overrides silently stop working on elements that were never touched.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [October 27, 2026, 6:51am UTC](https://forum.bricksbuilder.io/t/duplicate-mcp-saving-one-element-rewrites-the-custom-css-of-every-element-in-the-post/40702/3 "2026-10-27T06:51:52Z")

</div>

Hi Jonas,  
Thanks for the detailed report. Please confirm whether “Bi-directional sync between Custom CSS and style controls” is enabled under Bricks settings. That will help distinguish this from the existing CSS sync issue. Until this is confirmed, avoid MCP saves on affected pages and classes, since the reported changes can alter responsive layouts.

---

<div class="post-metadata">

**Author:** ![jonaswd](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@jonaswd](https://forum.bricksbuilder.io/u/jonaswd)\
**Post date:** [October 27, 2026, 9:44am UTC](https://forum.bricksbuilder.io/t/duplicate-mcp-saving-one-element-rewrites-the-custom-css-of-every-element-in-the-post/40702/4 "2026-10-27T09:44:00Z")

</div>

Hi @timmse,  
thanks for getting back!  
This option is disabled.

 ![Bildschirmfoto 2026-10-27 um 10.43.12](https://forum.bricksbuilder.io/uploads/default/original/3X/b/e/be8afc81df710c79a870297bc305d0a29c3d21a6.png)

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [October 27, 2026, 9:53am UTC](https://forum.bricksbuilder.io/t/duplicate-mcp-saving-one-element-rewrites-the-custom-css-of-every-element-in-the-post/40702/6 "2026-10-27T09:53:53Z")

</div>

Thanks for confirming. This matches the issue already tracked internally: [WIP: Abilities API ignores "Custom CSS sync" being off and moves Custom CSS into style controls](https://forum.bricksbuilder.io/t/40482). We’ll update that thread once it’s fixed. Until then, please avoid MCP saves on affected pages and classes.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [October 27, 2026, 9:53am UTC](https://forum.bricksbuilder.io/t/duplicate-mcp-saving-one-element-rewrites-the-custom-css-of-every-element-in-the-post/40702/7 "2026-10-27T09:53:59Z")

</div>

Closed on October 27, 2026, 9:53am UTC


