mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
refactor(components): convert const to reactive where appropriate
- Inline class assignments to avoid script-level clutter - Ignore a11y-missing-attribute instead of redundant href
This commit is contained in:
parent
4ed754c549
commit
c446fc74f4
94 changed files with 469 additions and 598 deletions
|
@ -3,8 +3,8 @@
|
|||
export { className as class };
|
||||
export let selected = false;
|
||||
export let text = 'Provide text';
|
||||
export let style = undefined;
|
||||
export let disabled = false;
|
||||
export let style = undefined;
|
||||
|
||||
import { cx } from '../../lib';
|
||||
import { getContext } from 'svelte';
|
||||
|
@ -20,7 +20,6 @@
|
|||
$: if (selected && buttonRef) {
|
||||
buttonRef.focus();
|
||||
}
|
||||
$: _class = cx('--content-switcher-btn', selected && '--content-switcher--selected', className);
|
||||
</script>
|
||||
|
||||
<button
|
||||
|
@ -28,7 +27,7 @@
|
|||
role="tab"
|
||||
tabindex={selected ? '0' : '-1'}
|
||||
aria-selected={selected}
|
||||
class={_class}
|
||||
class={cx('--content-switcher-btn', selected && '--content-switcher--selected', className)}
|
||||
on:click
|
||||
on:click|preventDefault={() => {
|
||||
update(id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue