Updates to docs + fix to cdnUrl

This commit is contained in:
Paul T 2018-06-30 17:38:44 -04:00
parent 979bf3b3f0
commit 9c59942dfb
2 changed files with 6 additions and 1 deletions

View file

@ -100,7 +100,12 @@ The `<box-icon>` custom element supports the following attributes:
- `shape`: one of the following values: `square`, `circle` - `shape`: one of the following values: `square`, `circle`
- `animation`: One of the following values: `spin`, `tada`, `flashing`, `burst`, `fade-left`, `fade-right`, `spin-hover`, `tada-hover`, `flashing-hover`, `burst-hover`, `fade-left-hover`, `fade-right-hover` - `animation`: One of the following values: `spin`, `tada`, `flashing`, `burst`, `fade-left`, `fade-right`, `spin-hover`, `tada-hover`, `flashing-hover`, `burst-hover`, `fade-left-hover`, `fade-right-hover`
The Custom Element class (`BoxIconElemnet`) exposes the following static members:
- `tagName`: property that holds the HTML element tag name. Default: `box-icon`
- `defined([tagName])`: Defines the Element in the custom element registry using either the tagName provided on input or the (default) the one defined on the Class.
- `cdnUrl`: property that holds the URL that will be used to retrieve the images. URL should point to the folder that contains the images. example: `//unpkg.com/boxicons@1.1.1/svg` (no trailing forward slash)
- `getIconSvg(iconName)`: method used to retrieve the SVG image. Should return a Promise that resolves with the SVG source (String).
## License ## License

View file

@ -74,7 +74,7 @@ export class BoxIconElement extends HTMLElement {
static get cdnUrl() { static get cdnUrl() {
// BUILD.DATA.VERSION is injected by webpack during a build. // BUILD.DATA.VERSION is injected by webpack during a build.
// Value is same as package.json#version property. // Value is same as package.json#version property.
return `https://unpkg.com/boxicons@${BUILD.DATA.VERSION}/svg`; return `//unpkg.com/boxicons@${BUILD.DATA.VERSION}/svg`;
} }
/** /**
* The html tag name to be use * The html tag name to be use