Skip to content

Commit

Permalink
chore: adjust minor typo and styling
Browse files Browse the repository at this point in the history
  • Loading branch information
vnphanquang committed Oct 8, 2024
1 parent 31a8d10 commit d13edc8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ When migrating to v2, you first need to update event attribute syntax to remove
<!-- ::: -->
```

If you previously used the `createLockScrollStore` helper, that is no longer support. Instead, extend from the pattern introduced in [Usage with Svelte Rune](#usage-with-svelte-rune).
If you previously used the `createLockScrollStore` helper, that is no longer supported. Instead, extend from the pattern introduced in [Usage with Svelte Rune](#usage-with-svelte-rune).

```svelte title="Migration to Svelte 5"
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ In the following minimal example, try dragging the <span class="bg-blue-200 text

`movable` provides two [CustomEvents][CustomEvent], `movablestart` and `movableend`, with `event.detail` as `MovableEventDetail`.

```typescript
/// title=MovableEventDetail
```typescript title=MovableEventDetail
export interface MovableEventDetail {
/** the node that the action was placed on */
node: HTMLElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const popover = {
// :::highlight
control: make((id: string) => {
// :::
// :::
return {
action: (node: HTMLButtonElement) => {
// regular runtime Svelte action business
Expand All @@ -17,12 +17,12 @@
popovertarget: id,
popovertargetaction: 'show',
} as HTMLButtonAttributes,
}
};
}),
// :::highlight
target: make((id: string) => {
// :::
// :::
return {
action: (node: HTMLDivElement) => {
// regular runtime Svelte action business
Expand All @@ -32,19 +32,19 @@
id,
popover: 'auto',
} as HTMLAttributes<HTMLDivElement>,
}
})
}
};
}),
};
</script>

<!-- :::highlight -->
<button use:apply={popover.control('my-popover')} class="c-btn">
<!-- ::: -->
<!-- ::: -->
Open Popover
</button>

<!-- :::highlight -->
<div use:apply={popover.target('my-popover')} class="p-10">
<!-- ::: -->
<div use:apply={popover.target('my-popover')} class="border-2 p-10">
<!-- ::: -->
My simple popover
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Acknowledgement

This package relies on [Svelte action] and attempts to stay minimal. If you are looking for a declarative, component-oriented solution, checkout [janosh/svelte-toc].
This package relies on [Svelte action] and attempts to stay minimal. If you are looking for a declarative, component-oriented solution, check out [janosh/svelte-toc].

## Installation

Expand Down

0 comments on commit d13edc8

Please sign in to comment.