CSS class binding

Hi again! I’ve recently been working on a grid that changes based on the state of the page (state.category === [blank]) and am working on changing that grid based on the CSS class chosen.

Ideally, I’d be able to bind these classes (such as .twobyfour or .fourbytwo) onto the grid and edit these classes through the custom CSS tab. If this is possible, please let me know :grinning: and if not, I’d love to hear if you think there’s another way to efficiently bind the css classes without having to edit/bind each setting individually under the styles tab.

thanks!

Hi @jackmielke,

Thanks for getting in touch.

You can use element binding to achieve this, you can find more about it at Querying state in css.
Other ways could be to use custom code to define CSS classes and use JS code to dynamically select them. You can find more about it at Adding custom code in the Builder.io visual editor - Builder.io

Let us know if you have any further questions. Thank you!