Closed Explosion-Scratch closed 3 years ago
Hi Atomico works on any CDN that supports ESM, example:
unpkg.com/atomico/core
: now in unpkg you should add the prefix core
, I will correct this in the next version.(it is already corrected in atomico@1.30.3)to use Atomico in the browser you only need the import, example:
import { c, html, css } from "https://cdn.skypack.dev/atomico";
function component(){
return html`<host shadowDom>
<h1>Atomic in browser</h1>
</host>`;
}
component.styles = css`
:host{
font-family: monospace;
color: crimson;
}
`
customElements.define("my-component",c(component));
by the way you can start with Atomico using the command npm init @atomico
or cloning this repo https://github.com/atomicojs/base, I invite you to join Discord
Thanks! Super excited to use this!
index.js
does not exist. Perhaps this is built somehow? Anyways, is there an alternate way to use atomico in the browser?