Skip to content

Commit 8c45345

Browse files
committed
load stylesheet first
1 parent 479a340 commit 8c45345

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/lib/editorFile.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,23 +224,25 @@ export default class EditorFile {
224224
href: "./res/file-icons/style.css",
225225
});
226226

227-
const content = tag("div", {
228-
className: "tab-page-content",
229-
});
230-
content.appendChild(options.content);
231-
232-
// Add stylesheet and content to shadow DOM
227+
// Add base styles to shadow DOM first
233228
shadow.appendChild(mainStyle);
234229
shadow.appendChild(iconStyle);
235230
shadow.appendChild(fileIconStyle);
236-
shadow.appendChild(content);
237-
238-
this.#content = container;
239231

240232
// Handle custom stylesheets if provided
241233
if (options.stylesheets) {
242234
this.#addCustomStyles(options.stylesheets, shadow);
243235
}
236+
237+
const content = tag("div", {
238+
className: "tab-page-content",
239+
});
240+
content.appendChild(options.content);
241+
242+
// Append content container to shadow DOM
243+
shadow.appendChild(content);
244+
245+
this.#content = container;
244246
} else {
245247
this.#content = options.content;
246248
}

0 commit comments

Comments
 (0)