I am trying to use some conditional logic to change the background color of a button. I have found posts on here that show you can in fact use the ternary operator to change the color prop but I have not found an example for users who liike to use the color variables defined in the theme options. If it is not possible is there a way to use the root defined variable color options?
<v-btn class="mx-2"
fab
dark
color="{toggleEdit ? primary : secondary}"
@@click.stop="toggleEdit = !toggleEdit">
<v-icon v-if="toggleEdit" dark>mdi-pencil</v-icon>
<v-icon v-else dark>mdi-check</v-icon>
</v-btn>
and
<v-btn class="mx-2"
fab
dark
color="{toggleEdit ? 'var(--primary)' : 'var(--secondary)'}"
@@click.stop="toggleEdit = !toggleEdit">
<v-icon v-if="toggleEdit" dark>mdi-pencil</v-icon>
<v-icon v-else dark>mdi-check</v-icon>
</v-btn>