Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Using Lit Element without npm directly in the browser
<!-- From: -->
<!doctype html>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src=""></script>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
<script type="module">
import {LitElement, html, css} from '';
class MyElement extends LitElement {
static get properties() {
return {
mood: {type: String}
static get styles() {
return css`.mood { color: green; }`;
render() {
return html`Web Components are <span class="mood">${this.mood}</span>!`;
customElements.define('my-element', MyElement);
<my-element mood="great"></my-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment