Skip to content

Commit dcde332

Browse files
authored
Merge pull request #15 from svelte-plugins/bug-fixes
fix(issues): collection of bug fixes and enhancements
2 parents 23acbf2 + 736045f commit dcde332

12 files changed

+711
-117
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Checkout out my <u use:tooltip={{ content: 'Hello World!' }}>tooltip</u>
4242
### Props
4343
| Prop | Description | Value |
4444
| :----------- | :------------------------------------------------------------------ | :---------------------------------------------- |
45+
| action | The action that triggers the tooltip (hover | click) | `string` (default: `hover`) |
4546
| animation | The animation to apply to the tooltip | `string` (default: ``) |
4647
| arrow | If `false`, the tooltip arrow will not be shown. | `boolean` (default: `true`) |
4748
| autoPosition | Adjust tooltip position if viewport clipping occurs | `string` (default: `false`) |
@@ -75,6 +76,7 @@ You can customize tooltips theme using several methods:
7576
Tooltip CSS variables:
7677

7778
```css
79+
--tooltip-arrow-size: 10px;
7880
--tooltip-background-color: rgba(0, 0, 0, 0.9);
7981
--tooltip-border-radius: 4px;
8082
--tooltip-box-shadow: 0 1px 20px rgba(0, 0, 0, 0.25);
@@ -87,8 +89,9 @@ Tooltip CSS variables:
8789
--tooltip-offset-x: 12px;
8890
--tooltip-offset-y: 12px;
8991
--tooltip-padding: 12px;
92+
--tooltip-white-space-hidden: nowrap;
93+
--tooltip-white-space-shown: normal;
9094
--tooltip-z-index: 100;
91-
--tooltip-arrow-size: 10px;
9295
```
9396

9497
### Using the theme property

docs/package-lock.json

+17-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/App.svelte

+9-7
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
<hr />
1414

15-
<h2>Examples using action</h2>
15+
<h2>Examples using action</h2>
1616

1717
<div class="example">
18-
<p>This tooltip should appear on the <u title="hello world!" use:tooltip>top</u> and use the content in the <code>title</code> attribute.</p>
18+
<p>This tooltip should appear on the <u title="hello world!" action="click" use:tooltip>top</u> when clicked. The content for the tooltip is provided by the <code>title</code> attribute.</p>
1919

20-
<Prism code={'<u title="hello world!" use:tooltip>top</u>'} />
20+
<Prism code={'<u title="hello world!" action="click" use:tooltip>top</u>'} />
2121
</div>
2222

2323
<div class="example">
@@ -27,9 +27,9 @@
2727
</div>
2828

2929
<div class="example">
30-
<p>This tooltip should appear to the <b use:tooltip={{ content: 'Whoa! I appear to the right.', position: 'right', theme: 'tooltip-theme' }}>right</b>.</p>
30+
<p>This tooltip should appear to the <b use:tooltip={{ content: 'Whoa! I appear to the right.', action: 'click', position: 'right', theme: 'tooltip-theme' }}>right</b> when clicked.</p>
3131

32-
<Prism code={"<b use:tooltip={{ content: 'Whoa! I appear to the right.', position: 'right', theme: 'tooltip-theme' }}>right</b>"} />
32+
<Prism code={"<b use:tooltip={{ content: 'Whoa! I appear to the right.', position: 'right', action: 'click', theme: 'tooltip-theme' }}>right</b>"} />
3333

3434
<p>This is also demonstrates the use of the <code>theme</code> property:</p>
3535

@@ -83,7 +83,7 @@
8383
</div>
8484

8585
<div class="example">
86-
This tooltip should appear on the <Tooltip content="<b>Tooltip Top</b><p>This is an example of using HTML and content wrapping.</p>" position="top" animation="slide" arrow={false}><i>top</i>.</Tooltip>
86+
This tooltip should appear on the <Tooltip content="<b>Tooltip Top</b><p>This is an example of using HTML and content wrapping.</p>" position="top" animation="slide" arrow={false}><i>top</i></Tooltip> when I hover.
8787
</div>
8888

8989
<div class="example">
@@ -92,14 +92,16 @@
9292
<Tooltip
9393
content="Whoa! I appear to the right."
9494
position="right"
95+
action="click"
9596
theme="tooltip-theme">
96-
<b>right</b>.
97+
<b>right</b> when clicked.
9798
</Tooltip>
9899
</p>
99100
<Prism showLineNumbers={true} code={`
100101
<Tooltip
101102
content="Whoa! I appear to the right."
102103
position="right"
104+
action="click"
103105
theme="tooltip-theme">
104106
<b>right</b>
105107
</Tooltip>

0 commit comments

Comments
 (0)