nbhi 0.6.5 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/javascript/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ For no-build solutions:
|
|
|
36
36
|
|
|
37
37
|
```js
|
|
38
38
|
<script type="module">
|
|
39
|
-
import { initialize } from 'https://
|
|
39
|
+
import { initialize } from 'https://cdn.jsdelivr.net/npm/nbhi@x.x.x/+esm';
|
|
40
40
|
await initialize();
|
|
41
41
|
</script>
|
|
42
42
|
```
|
|
@@ -286,6 +286,15 @@ const internals = validate('my-form-field'); // Returns elementInternals
|
|
|
286
286
|
internals.checkValidity();
|
|
287
287
|
internals.validity;
|
|
288
288
|
```
|
|
289
|
+
## Inherit styles
|
|
290
|
+
|
|
291
|
+
Your components can inherit global styles. These styles are copied once and a reference to those styles are given to each web component keeping it performant.
|
|
292
|
+
This function is handy if you have global styles that a component needs to inherit from.
|
|
293
|
+
|
|
294
|
+
```html
|
|
295
|
+
<link rel="stylesheet" data-inherit="true" href="...">
|
|
296
|
+
```
|
|
297
|
+
|
|
289
298
|
|
|
290
299
|
## FAQ
|
|
291
300
|
|
package/javascript/index.js
CHANGED
|
@@ -73,7 +73,7 @@ async function initialize({ prefix = 'db', source = '/components' } = {}) {
|
|
|
73
73
|
? `${ source }/${ fileName }.html` : source[fileName];
|
|
74
74
|
const response = await fetch(relativePath);
|
|
75
75
|
if (!response.ok) {
|
|
76
|
-
throw new Error(`Could not find component
|
|
76
|
+
throw new Error(`Could not find component ${ name }`);
|
|
77
77
|
}
|
|
78
78
|
const templateAsString = await response.text();
|
|
79
79
|
const document = new DOMParser().parseFromString(templateAsString, 'text/html');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nbhi",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "No-Build HTML Includes (NBHI) is a simple library that allows you to include html files into other html files and turns them into [web components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components). Lazy initialization of content (when entering the viewport) and a one line call to update/hydrate content in your html pages. No build tools required, no `package.json` needed.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|