Commit Graph
5 Commits
Author SHA1 Message Date
Sean Perkins cafe8e6541 chore: exclude playwright test infra and test svg assets from collection output (#1143) 2022-11-08 14:33:56 -05:00
Liam DeBeasi 24caaad7d9 fix(build): add old ionicons.js file (#982) 2021-06-17 09:51:50 -04:00
Adam Bradley 66556ea45c feat(custom-elements): export ionicons/components
Also provide ionicons as a custom element which can be defined using `customElements.define()`

```
import { IonIcon } from "ionicons/components/ion-icon";
customElements.define("ion-icon", IonIcon);
```

The custom element build works the same as the lazy load build, and is also able to lazy load svgs on demand, either by giving it an exact url in the `src` attribute `<ion-icon src="./path/to/airplane.svg"></ion-icon>`, or by providing the name of the ionicon to load `<ion-icon name="airplane"></ion-icon>`.

If using the `name` attribute, you'll also need to set where to find the svg directory using `setAssetPath()`

```
import { setAssetPath } from "ionicons/components";
setAssetPath(location.href);
```
2021-02-01 15:28:33 -06:00
Adam Bradley 3aed6eee31 fix(types): temporary fix for projects using older typescript versions 2020-06-25 17:32:53 -05:00
Adam Bradley 1286103494 chore(collection): update dist/collection to use optimized svgs 2019-10-15 11:15:22 -05:00