Bundle all dynamically loaded css (#28)

* static css

* Fix css import in tests
This commit is contained in:
Chenlei Hu
2024-06-18 13:58:21 -04:00
committed by GitHub
parent c064e2cc80
commit d7bf368cec
8 changed files with 26 additions and 9 deletions

View File

@@ -1,7 +1,5 @@
import { addStylesheet } from "../utils";
import "./spinner.css";
// @ts-ignore
addStylesheet(import.meta.url);
export function createSpinner() {
const div = document.createElement("div");

View File

@@ -1,7 +1,8 @@
import { api } from "../api";
import { $el } from "../ui";
import { addStylesheet } from "../utils";
import { createSpinner } from "./spinner";
import "./userSelection.css";
interface SelectedUser {
username: string;
@@ -9,11 +10,9 @@ interface SelectedUser {
created: boolean;
}
export class UserSelectionScreen {
async show(users, user): Promise<SelectedUser>{
// This will rarely be hit so move the loading to on demand
// @ts-ignore
await addStylesheet(import.meta.url);
const userSelection = document.getElementById("comfy-user-selection");
userSelection.style.display = "";
return new Promise((resolve) => {