Skip to content

Commit 07354cd

Browse files
committed
docs(examples): update copy on examples to showcase outside click and show
1 parent 2dc36a1 commit 07354cd

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

docs/src/App.svelte

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
let showTooltip = false;
77
let autoHideTooltip = true;
8-
``;
8+
99
setTimeout(() => {
1010
autoHideTooltip = false;
1111
}, 5000);
@@ -408,34 +408,27 @@
408408
<section>
409409
<h2>Playground</h2>
410410
</section>
411-
<section class="relative-with-offset">
412-
<p>
411+
<div>
412+
<p class="relative-with-offset">
413413
Mouse over <strong
414414
use:tooltip={{ content: 'Hello world', position: 'left' }}>me</strong
415-
> to see a tooltip in the correct position.
416-
</p>
417-
</section>
418-
<div class="relative-with-offset">
419-
<p>
420-
Mouse over <strong
421-
use:tooltip={{ content: 'Hello world', position: 'left' }}>me</strong
422-
> to see a tooltip in the wrong position.
415+
> to see a left positioned tooltip with relative offset parent
423416
</p>
424417
</div>
425418
<div class="relative-with-offset">
426419
<p>Mouse over</p>
427420
<strong use:tooltip={{ content: 'Hello world', position: 'bottom' }}
428421
>me</strong
429422
>
430-
<p>to see a tooltip in the wrong position.</p>
423+
<p>to see a bottom positioned tooltip with relative offset parent.</p>
431424
</div>
432425
<div class="relative-with-offset">
433426
<p>Mouse over</p>
434427
<strong
435428
class="absolute-child"
436429
use:tooltip={{ content: 'Hello world', position: 'top' }}>me</strong
437430
>
438-
<p>to see a tooltip in the wrong position.</p>
431+
<p>to see a top positioned tooltip.</p>
439432
</div>
440433
<p>A bunch of paragraphs.</p>
441434
<p>A bunch of paragraphs.</p>
@@ -445,11 +438,10 @@
445438
<p>A bunch of paragraphs.</p>
446439
<div class="relative-with-offset">
447440
<p>
448-
Mouse over <strong
441+
Mouse <strong
449442
class="absolute-child"
450-
use:tooltip={{ content: 'Hello world', position: 'right' }}>me</strong
451-
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to see a tooltip in
452-
the wrong position.
443+
use:tooltip={{ content: 'Hello world', position: 'right' }}>over</strong>
444+
this relative parent with absolute child.
453445
</p>
454446
</div>
455447
<p>A bunch of paragraphs.</p>
@@ -465,19 +457,19 @@
465457
<p>A bunch of paragraphs.</p>
466458
<p>A bunch of paragraphs.</p>
467459
</main>
468-
<p>Mouse over <strong use:tooltip={{ content: 'Hello world', position: 'left' }}>me</strong> to see a tooltip in the correct position.</p>
460+
<p>Mouse over <strong use:tooltip={{ content: 'Hello world', position: 'left' }}>me</strong> static tooltip element.</p>
469461
<div class="relative-with-offset">
470-
<p>Mouse over <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'top' }}>me</strong> to see a tooltip in the wrong position.</p>
462+
<p>Mouse over <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'top' }}>me</strong> with relative offset parent and absolute child.</p>
471463
</div>
472464
<div class="relative-with-offset">
473465
<p>Mouse over</p>
474-
<strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'bottom' }}>me</strong>
475-
<p>to see a tooltip in the wrong position.</p>
466+
<strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'bottom' }}>this</strong>
467+
<p>relative parent with offset and absolute child.</p>
476468
</div>
477469
<div class="relative-with-offset">
478470
<p>Mouse over</p>
479471
<strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'right' }}>me</strong>
480-
<p>to see a tooltip in the wrong position.</p>
472+
<p>relative parent with offset and absolute child.</p>
481473
</div>
482474
<p>A bunch of paragraphs.</p>
483475
<p>A bunch of paragraphs.</p>
@@ -486,7 +478,7 @@
486478
<p>A bunch of paragraphs.</p>
487479
<p>A bunch of paragraphs.</p>
488480
<div class="relative">
489-
<p>Mouse over <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'left' }}>me</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to see a tooltip in the wrong position.</p>
481+
<p>Mouse over <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'right' }}>me</strong> with relative parent (no offset) and absolute child.</p>
490482
</div>
491483
<p>A bunch of paragraphs.</p>
492484
<p>A bunch of paragraphs.</p>
@@ -497,7 +489,7 @@
497489
<p>A bunch of paragraphs.</p>
498490
<div>
499491
<p class="transform">
500-
This tooltip is using transform on the element - <u
492+
Tooltip is using a CSS transform on the tooltip element - show <u
501493
title="hello world!"
502494
action="click"
503495
use:tooltip>top</u
@@ -512,7 +504,7 @@
512504

513505
<div class="transform">
514506
<p>
515-
This tooltips parent is using a transform - <u
507+
Tooltip parent is using a CSS transform - show <u
516508
title="hello world!"
517509
action="click"
518510
use:tooltip>top</u
@@ -528,7 +520,7 @@
528520

529521
<div class="relative transform">
530522
<p>
531-
This tooltips parent is relative using a transform - <u
523+
Tooltip parent is relative and using a CSS transform - show <u
532524
title="hello world!"
533525
action="click"
534526
use:tooltip>top</u
@@ -542,7 +534,7 @@
542534

543535
<div class="transform" style="position: absolute; left: 300px;">
544536
<p>
545-
This tooltips parent is absolute using a transform - <u
537+
Tooltip parent is absolute and using a CSS transform - show <u
546538
title="hello world!"
547539
action="click"
548540
use:tooltip>top</u

0 commit comments

Comments
 (0)