Environment
- Bricks: 2.4-beta3
- Bricks Abilities contract: 2.0.0
- MCP Adapter: 0.6.1
- WordPress: 7.0.4
Summary
The MCP abilities for creating and updating global classes expose a writable selectors array for descendant, pseudo-element, and other chained selectors.
Rules saved through this field render correctly on the frontend, but they are not shown in the global class’s Style panel or Class Manager. This allows an MCP client to create functional CSS that a Bricks user cannot discover or edit through the builder.
For editor-visible chained rules, the working representation is the global class’s Custom CSS field:
%root% .employees__group-title {
color: var(--primary);
}
Through MCP, this belongs in settings._cssCustom rather than the global class’s selectors array.
Current MCP guidance
bricks/create-global-classdescribesselectorsas “Custom CSS sub-selectors” and provides&::beforeas an example.bricks/batch-create-global-classesprovides the same guidance.bricks/update-global-classaccepts a complete replacementselectorsarray.- The resolved global-class schema says selector entries allow settings to be scoped to arbitrary CSS selectors.
- The schema describes
labelas an optional display label in the builder UI. - Neither the abilities nor the installed Bricks skills warn that these selector records may be invisible in the builder.
- The installed skills do not document
%root%for global-class Custom CSS.
Steps to reproduce
-
Create or update a global class through MCP with a selector record similar to:
{ "name": "selector-test", "selectors": [ { "selector": "& .selector-test__child", "label": "Child", "settings": { "_typography": { "color": { "raw": "var(--primary)" } } } } ] } -
Apply the global class to an element containing
.selector-test__child. -
Confirm that the resulting CSS affects the frontend.
-
Open the global class in the Bricks Style panel and Class Manager.
-
Observe that the descendant rule cannot be found or edited.
-
Move the rule to
settings._cssCustom, using%root%in the builder representation. -
Confirm that it is now visible under Style → CSS → Custom CSS.
Actual result
The rule renders on the frontend, but the Bricks user cannot find or edit it in the normal builder interface.
Expected result
One of the following should apply:
- Selector records are exposed and editable in the Bricks UI; or
- MCP abilities and skills clearly state that
selectorsmust not be used for editor-visible global-class rules and direct clients tosettings._cssCustomwith%root%.
Impact
This creates hidden styling state:
- Users cannot determine where an active rule originates.
- Future builder edits can conflict with rules the editor does not expose.
- Class audits incorrectly appear clean.
- Repair requires inspecting raw MCP or global-class data.