refactor: prefer class directive over class attribute (#1318)

This commit is contained in:
metonym 2022-05-29 08:16:27 -07:00 committed by GitHub
commit 0801e1d078
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 18 deletions

View file

@ -67,7 +67,11 @@
class:bx--btn="{true}"
class:bx--btn--sm="{true}"
class:bx--btn--disabled="{disabled}"
class="{kind && `bx--btn--${kind}`}"
class:bx--btn--primary="{kind === 'primary'}"
class:bx--btn--secondary="{kind === 'secondary'}"
class:bx--btn--tertiary="{kind === 'tertiary'}"
class:bx--btn--ghost="{kind === 'ghost'}"
class:bx--btn--danger="{kind === 'danger'}"
on:keydown
on:keydown="{({ key }) => {
if (key === ' ' || key === 'Enter') {