Skip to content

Commit

Permalink
fix: Update README etc (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfreear committed Mar 31, 2022
1 parent 1533611 commit 5de644f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,27 @@ A collection of experimental Web Components.

About [Web Components][mdn].

See also: [web-vitals-element][].

## Usage

Available on [Unpkg][] and [Skypack][] CDNs. Note, templates can't currently be accessed from Skypack.

```html
<my-skip-link></my-skip-link>


<my-options template-host="github.io"></my-options>
<my-options template-host="unpkg.com"></my-options>

<script src="https://nfreear.github.io/web-components/index.js"
<script src="https://cdn.skypack.dev/ndf-web-components?min"
type="module" async crossorigin
></script>
```

## Custom import

```js
import { customImport } from 'https://nfreear.github.io/web-components/custom.js';
import { customImport } from 'https://unpkg.com/ndf-web-components@1.1.0/custom.js';

const MOD = await customImport('my-star-rating, my-skip-link');
```
Expand All @@ -62,4 +66,9 @@ Then:
[mit]: https://nfreear.mit-license.org/#2021
[npm]: https://www.npmjs.com/package/ndf-web-components
[npm-img]: https://img.shields.io/npm/v/ndf-web-components
[unpkg]: https://unpkg.com "A fast, global content delivery network for everything on npm"
[up-cdn]: https://unpkg.com/[email protected]/index.js
[skypack]: https://cdn.skypack.dev "A JavaScript Delivery Network for modern web apps"
[sp-cdn]: https://cdn.skypack.dev/ndf-web-components
[mdn]: https://developer.mozilla.org/en-US/docs/Web/Web_Components
[web-vitals-element]: https://github.com/stefanjudis/web-vitals-element
10 changes: 5 additions & 5 deletions demo/my-options.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ <h2> my-options </h2>

<p> Set some options and use the custom importer. </p>

<pre>
<my-code>
&lt;my-options
template-host="github.io"
use="my-page,my-skip-link,my-star-rating"
>&lt;/my-options>
</pre>
</my-code>

<h2> Test </h2>

Expand All @@ -28,13 +28,13 @@ <h2> Test </h2>

<my-options
template-host="github.io"
use="my-page, my-skip-link,my-star-rating"
use="my-page, my-skip-link, my-analytics, my-fork-me, my-star-rating"
></my-options>


<script
src="../custom.js"
data-X-src="https://nfreear.github.io/web-components/index.js"
data-X-src="../custom.js"
src="https://nfreear.github.io/web-components/custom.js"
type="module" async crossorigin
></script>

Expand Down

0 comments on commit 5de644f

Please sign in to comment.