Bind a class to an element based on an expression
<style> .bg-violet { background-color: '#7c3aed' } </style> <div x-bind:class="bg-violet if your_condition">
Last updated 2 years ago