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
- Page with several elements whose Custom CSS contains comments and an
@mediablock at the end. - Use
bricks/update-elementto change one unrelated setting on a different element (e.g._gridTemplateColumns). - 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/@containerblocks 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:
/* 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.
