Reg. what you were talking about in the video with properties being for style/css settings. Obv I canât speak for the Bricks team, but I canât imagine thisâll be included with their components feature. I think the ability to change classes per instance will be the way to do what youâre trying to do (for changing styles per instance).
If you think about it, for each instance of the component, you are able to change the HTML through properties⊠the HTML tag, the content, attributes/classes & the configuration (when it comes to things like sliders, which really is just changing the attribute values).
But with CSS, itâs per page. You canât make a CSS rule apply to only one instance of a component, unless it has different markup to be able to target it separately with a different selector.
In your example, trying to add a gap property to the element with the ID âbrxe-baocpxâ what would you expect that to look like in the final CSS if you were able to populate with the property and had two different instances of the same component, with different values for the gap?
Without any different classes or changes to the markup⊠it would just be overridden as the selector would be the same for eachâŠ
/* first instance */
.brxe-baocpx {
gap: 0.2em;
}
/* second instance */
.brxe-baocpx {
gap: 0.4em;
}
(classes used because IDâs are removed in components)
I canât imagine what the expected result would be. Bricks could do something like automatically add a component instance ID to every element as another class, and join the classes⊠something likeâŠ
.brxe-baocpx.fjhvsa {
gap: 0.2em;
}
.brxe-baocpx.rjsfsjf {
gap: 0.4em;
}
But then weâre back to class chaining.
itâs the same issue with the accent color variable example, what selector/rule would you be expecting to see in the stylesheet for the page if you had been able to use the âprimaryâ accent color property in your CSS for that element ID? How would it be applied to only that one instance?
edit - I guess a component attribute could workâŠ
:where([data-comp-instance="fjhvsa"]).brxe-baocpx {
gap: 0.2em;
}
:where([data-comp-instance="rjsfsjf"]).brxe-baocpx {
gap: 0.4em;
}
Just thinking through the idea out loud
Just not currently sure itâs a good idea when classes / scoped vars already do the trick of scoping styles. Happy to be convinced otherwise though.