diff --git a/.gitignore b/.gitignore index 99600f9..2d9bb4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -yarn-error.log \ No newline at end of file +yarn-error.log +dist \ No newline at end of file diff --git a/index.html b/index.html index 7c67f04..6bcc48d 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ + Document diff --git a/src/pages/IndexPage.ts b/src/pages/IndexPage.ts index 7d2bf02..2194151 100644 --- a/src/pages/IndexPage.ts +++ b/src/pages/IndexPage.ts @@ -4,7 +4,6 @@ import { html, LitElement } from "lit"; import { customElement } from "lit/decorators.js"; import "../components/HelloWorld"; -import "../styles/main.css"; import { TW } from "../util/TailwindMixin"; @customElement("x-index-page") diff --git a/src/util/TailwindMixin.ts b/src/util/TailwindMixin.ts index e0116f6..05d8e76 100644 --- a/src/util/TailwindMixin.ts +++ b/src/util/TailwindMixin.ts @@ -3,11 +3,8 @@ export const TW = (superClass: T): T => connectedCallback() { super.connectedCallback(); - const link = document.createElement("link"); - link.rel = "stylesheet"; - link.type = "text/css"; - link.href = new URL("../styles/main.css", import.meta.url).href; - - this.shadowRoot.append(link); + document.head.querySelectorAll("link[rel='stylesheet']").forEach((link) => { + this.shadowRoot.append(link.cloneNode()); + }); } }; diff --git a/vite.config.js b/vite.config.js index 47a03ca..62050c6 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,4 +1,3 @@ import { defineConfig } from 'vite'; -defineConfig({ -}); \ No newline at end of file +export default defineConfig({}); \ No newline at end of file