-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pins external library versions, other housekeeping
- Loading branch information
Showing
14 changed files
with
124 additions
and
134 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
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,31 @@ | ||
import BaseElement from './base-element.js'; | ||
|
||
export default class DemoLitHtml extends BaseElement { | ||
static get properties() { | ||
return { | ||
emoji: { | ||
type: String, | ||
}, | ||
message: { | ||
type: String, | ||
}, | ||
}; | ||
} | ||
|
||
// What's injected into the "template" function is defined in "BaseElement". | ||
static template(html, { ifDefined }) { | ||
return ({ emoji, message }) => { | ||
return html` | ||
<style> | ||
#container[emoji]::before { | ||
content: " " attr(emoji); | ||
font-size: 2rem; | ||
} | ||
</style> | ||
<div id="container" emoji="${ifDefined(emoji)}">Rendered “${message}” using <code>lit-html</code>.</div> | ||
`; | ||
}; | ||
} | ||
} | ||
|
||
customElements.define('demo-lit-html', DemoLitHtml); |
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<script type="module" src="./lit-html-element.js"></script> | ||
<script type="module" src="./demo-lit-html.js"></script> | ||
</head> | ||
<body> | ||
<lit-html-element message=" woo! "></lit-html-element> | ||
<lit-html-element message=" yay! "></lit-html-element> | ||
<lit-html-element message=" woo! "></lit-html-element> | ||
<ol> | ||
<li><demo-lit-html message="one" emoji="🔥"></demo-lit-html></li> | ||
<li><demo-lit-html message="two" emoji="😻"></demo-lit-html></li> | ||
<li><demo-lit-html message="three" emoji="✌️"></demo-lit-html></li> | ||
</ol> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
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
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,31 @@ | ||
import BaseElement from './base-element.js'; | ||
|
||
export default class DemoUhtml extends BaseElement { | ||
static get properties() { | ||
return { | ||
emoji: { | ||
type: String, | ||
}, | ||
message: { | ||
type: String, | ||
}, | ||
}; | ||
} | ||
|
||
// What's injected into the "template" function is defined in "BaseElement". | ||
static template(html) { | ||
return ({ emoji, message }) => { | ||
return html` | ||
<style> | ||
#container[emoji]::before { | ||
content: " " attr(emoji); | ||
font-size: 2rem; | ||
} | ||
</style> | ||
<div id="container" emoji="${emoji}">Rendered “${message}” using <code>µhtml</code>.</div> | ||
`; | ||
}; | ||
} | ||
} | ||
|
||
customElements.define('demo-uhtml', DemoUhtml); |
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<script type="module" src="./uhtml-element.js"></script> | ||
<script type="module" src="./demo-uhtml.js"></script> | ||
</head> | ||
<body> | ||
<uhtml-element message=" woo! "></uhtml-element> | ||
<uhtml-element message=" yay! "></uhtml-element> | ||
<uhtml-element message=" woo! "></uhtml-element> | ||
<ol> | ||
<li><demo-uhtml message="one" emoji="🔥"></demo-uhtml></li> | ||
<li><demo-uhtml message="two" emoji="😻"></demo-uhtml></li> | ||
<li><demo-uhtml message="three" emoji="✌️"></demo-uhtml></li> | ||
</ol> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{ | ||
"name": "@netflix/x-element", | ||
"author": "Casey Klebba", | ||
"description": "Custom Element base class.", | ||
"description": "A dead simple starting point for custom elements.", | ||
"version": "1.0.0-rc.57", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"license": "Apache-2.0", | ||
"repository": "https://github.com/Netflix/x-element", | ||
"type": "module", | ||
"main": "x-element.js", | ||
|
@@ -31,5 +30,15 @@ | |
"http-server": "^14.1.1", | ||
"puppeteer": "^21.10.0", | ||
"tap-parser": "^15.3.1" | ||
} | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Andrew Seier", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Casey Klebba", | ||
"email": "[email protected]" | ||
} | ||
] | ||
} |