use svelte class directive for conditional classes

This commit is contained in:
2023-08-25 18:49:03 +02:00
parent 29f4f0c497
commit 4f99847d62
4 changed files with 18 additions and 6 deletions

View File

@ -33,11 +33,9 @@
{/if}
<div class="flex items-center">
<input
class={type === 'checkbox'
? 'checkbox'
: `input input-bordered w-[100%] sm:max-w-[16rem] ${
initialType === 'password' ? 'pr-11' : ''
}`}
class:checkbox={type === 'checkbox'}
class:input,input-bordered,w-[100%],sm:max-w-[16rem]={type !== 'checkbox'}
class:pr-11={initialType === 'password'}
{id}
{name}
{type}