-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
979 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
## `<template is="literal-shadow">` | ||
|
||
A `literal-shadow` template is replaced in the DOM with its own rendered content. | ||
HTML `<template>`s are allowed pretty much anywhere in a document, so | ||
`literal-shadow` templates enable you to freely mix islands of dynamically | ||
rendered content into your HTML. | ||
|
||
|
||
### Register `literal-shadow` | ||
|
||
Importing `./build/literal-shadow/module.js` from the [repository](https://github.com/stephband/literal/) | ||
registers `<template is="literal-shadow">` as a customised built-in template | ||
element. (Support is polyfilled in Safari, who [refuse to implement customised built-ins](https://github.com/WebKit/standards-positions/issues/97])). | ||
|
||
```html | ||
<script src="https://stephen.band/literal/build/literal-shadow/module.js" type="module"></script> | ||
``` | ||
|
||
|
||
### Author a `literal-shadow` template | ||
|
||
```html | ||
<article> | ||
<template is="literal-shadow"> | ||
<p>${ events('pointermove', body).map((e) => round(e.pageX)) }px</p> | ||
</template> | ||
</article> | ||
``` | ||
<div class="demo-block block"> | ||
<article> | ||
<template is="literal-shadow"> | ||
<p>${ events('pointermove', body).map((e) => round(e.pageX)) }px</p> | ||
</template> | ||
</article> | ||
</div> | ||
|
Oops, something went wrong.