diff --git a/docs/pages/components/split-panel.md b/docs/pages/components/split-panel.md index a2ab13b34..e2717d13f 100644 --- a/docs/pages/components/split-panel.md +++ b/docs/pages/components/split-panel.md @@ -9,13 +9,13 @@ layout: component
Start
End
@@ -69,13 +69,13 @@ To set the initial position, use the `position` attribute. If no position is pro
Start
End
@@ -90,13 +90,13 @@ To set the initial position in pixels instead of a percentage, use the `position
Start
End
@@ -148,13 +148,13 @@ Add the `vertical` attribute to render the split panel in a vertical orientation
Start
End
@@ -207,13 +207,13 @@ To snap panels at specific positions while dragging, add the `snap` attribute wi
Start
End
@@ -328,13 +328,13 @@ Add the `disabled` attribute to prevent the divider from being repositioned.
Start
End
@@ -389,13 +389,13 @@ Try resizing the example below with each option and notice how the panels respon
Start
End
@@ -482,13 +482,13 @@ This examples demonstrates how you can ensure both panels are at least 150px usi
Start
End
@@ -540,7 +540,7 @@ Create complex layouts that can be repositioned independently by nesting split p
Start
@@ -548,13 +548,13 @@ Create complex layouts that can be repositioned independently by nesting split p
Top
Bottom
@@ -625,13 +625,13 @@ You can target the `divider` part to apply CSS properties to the divider. To add
Start
End
@@ -684,13 +684,13 @@ Here's a more elaborate example that changes the divider's color and width and a
Start
End
diff --git a/docs/pages/getting-started/installation.md b/docs/pages/getting-started/installation.md index 792397a77..cbef3331b 100644 --- a/docs/pages/getting-started/installation.md +++ b/docs/pages/getting-started/installation.md @@ -112,15 +112,29 @@ However, if you're [cherry picking](#cherry-picking) or [bundling](#bundling) Sh ``` :::tip -When setting a basePath, and easy way to check if it was down properly is by checking if an icon exists. - -For example, if I set the basePath to `/dist`, I should be able to go to: - -`https:///dist/assets/icons/arrow-left.svg` and the browser should show me the SVG. - -Shoelace also exports a `getBasePath()` method you can use to reference assets. +An easy way to make sure the base path is configured properly is to check if [icons](/components/icon) are loading. ::: +### Referencing Assets + +Most of the magic behind assets is handled internally by Shoelace, but if you need to reference the base path for any reason, the same module exports a function called `getBasePath()`. An optional string argument can be passed, allowing you to get the full path to any asset. + +```html + +``` + ## Cherry Picking Cherry picking can be done from [the CDN](#cdn-installation-easiest) or from [npm](#npm-installation). This approach will load only the components you need up front, while limiting the number of files the browser has to download. The disadvantage is that you need to import each individual component. diff --git a/src/components/popup/popup.ts b/src/components/popup/popup.ts index 205a501fc..438ba7ba1 100644 --- a/src/components/popup/popup.ts +++ b/src/components/popup/popup.ts @@ -7,6 +7,14 @@ import ShoelaceElement from '../../internal/shoelace-element.js'; import styles from './popup.styles.js'; import type { CSSResultGroup } from 'lit'; +export interface VirtualElement { + getBoundingClientRect: () => DOMRect; +} + +function isVirtualElement(e: unknown): e is VirtualElement { + return e !== null && typeof e === 'object' && 'getBoundingClientRect' in e; +} + /** * @summary Popup is a utility that lets you declaratively anchor "popup" containers to another element. * @documentation https://shoelace.style/components/popup @@ -35,15 +43,6 @@ import type { CSSResultGroup } from 'lit'; * popup can be before overflowing. Useful for positioning child elements that need to overflow. This property is only * available when using `auto-size`. */ - -export interface VirtualElement { - getBoundingClientRect: () => DOMRect; -} - -function isVirtualElement(e: unknown): e is VirtualElement { - return e !== null && typeof e === 'object' && 'getBoundingClientRect' in e; -} - @customElement('sl-popup') export default class SlPopup extends ShoelaceElement { static styles: CSSResultGroup = styles;