mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
Merge branch 'next' of https://github.com/shoelace-style/shoelace into next
This commit is contained in:
@@ -163,5 +163,15 @@ To override it globally, set it in a root block in your stylesheet after `shoela
|
||||
}
|
||||
```
|
||||
|
||||
### Custom content
|
||||
|
||||
Use the `content` slot to pass an element to the tooltip.
|
||||
|
||||
```html preview
|
||||
<sl-tooltip>
|
||||
<sl-button>Hover me</sl-button>
|
||||
<strong slot="content">Bolded content</strong>
|
||||
</sl-tooltip>
|
||||
```
|
||||
|
||||
[component-metadata:sl-tooltip]
|
||||
|
||||
@@ -8,6 +8,7 @@ let id = 0;
|
||||
* @status stable
|
||||
*
|
||||
* @slot - The tooltip's target element. Only the first element will be used as the target.
|
||||
* @slot content - The tooltip's content. Alternatively, you can use the content prop.
|
||||
*
|
||||
* @part base - The component's base wrapper.
|
||||
*/
|
||||
@@ -253,7 +254,7 @@ export class Tooltip {
|
||||
role="tooltip"
|
||||
aria-hidden={this.open ? 'false' : 'true'}
|
||||
>
|
||||
{this.content}
|
||||
<slot name="content">{this.content}</slot>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user