xtal-sip
Version:
Dynamically "water" a custom element tag with the necessary dependencies to sprout the tag from an inert seedling to a thing of beauty.
20 lines • 704 B
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<sl-button>Click me</sl-button>
<script type=module>
import {conditionalImport} from '../conditionalImport.js';
conditionalImport(document.body, {
'sl-button': [
[,,'//cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.21/dist/shoelace/shoelace.css',,{cssScope: 'global'}],
[,,'//cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.21/dist/shoelace/shoelace.esm.js']
]
})
</script>
</body>
</html>