Page Title 
           
           
               
          
      
      

HTML and inline JavaScript

JavaScript

Tagged template literals

Set the type attribute to js, jsx or javascript when using tagged template literals.

The render function is what you'd expect for LitElement to render HTML on update of ANYTHING that it knows about.

Notice that we render the styles inside the HTML. This is NOT standard but makes it easier to read.

Classes will always be used in OOP JavaScript.

The next thing!

:host is a VERY special selector that ONLY works in shadowRoots! This is like saying "do this stuff to ME" which is NO WHERE ELSE POSSIBLE! At the document level though, there's :root which IS THE MOST GENERIC SELECTOR which is soooooorta like the defaults for the very very top of the document cascade.

:host is a VERY special selector that ONLY works in shadowRoots! This is like saying "do this stuff to ME" which is NO WHERE ELSE POSSIBLE! At the document level though, there's :root which IS THE MOST GENERIC SELECTOR which is soooooorta like the defaults for the very very top of the document cascade.

CSS

Rendered code

Use the boolean attribute render to render the code inside the <template> tag.

php

Copy to clipboard button

Use the boolean attribute copy-clipboard-button to display a "copy" button on the top right corner.

Change content dynamically

Custom background colors