MCPcopy Index your code
hub / github.com/pythongosssss/ComfyUI-Custom-Scripts / addStylesheet

Function addStylesheet

web/js/common/utils.js:3–13  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

1import { $el } from "../../../../scripts/ui.js";
2
3export function addStylesheet(url) {
4 if (url.endsWith(".js")) {
5 url = url.substr(0, url.length - 2) + "css";
6 }
7 $el("link", {
8 parent: document.head,
9 rel: "stylesheet",
10 type: "text/css",
11 href: url.startsWith("http") ? url : getUrl(url),
12 });
13}
14
15export function getUrl(path, baseUrl) {
16 if (baseUrl) {

Callers 4

lightbox.jsFile · 0.90
spinner.jsFile · 0.90
modelInfoDialog.jsFile · 0.90
autocomplete.jsFile · 0.90

Calls 1

getUrlFunction · 0.70

Tested by

no test coverage detected