Skip to content

Commit 3a3a2d4

Browse files
authored
Merge pull request #160 from tkskto/feature/change-css-path
fix: fix specific path.
2 parents b48f82b + 8aeae95 commit 3a3a2d4

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/client/style.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
class StyleGetter {
22
private _style = '';
33

4-
private getStyle = () => fetch('/dist/style.css').then((res) => res.text());
4+
private getStyle = async () => {
5+
const styleElement: HTMLLinkElement | null = document.querySelector('#style');
6+
let style = '';
7+
8+
if (styleElement) {
9+
style = await fetch(styleElement.href).then((res) => res.text());
10+
}
11+
12+
return style;
13+
};
514

615
/**
716
* get css strings for SVG Image

views/viewer.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title><%- title %></title>
7-
<link rel="stylesheet" href="../dist/style.css">
7+
<link id="style" rel="stylesheet" href="/dist/style.css">
88
<script>
99
window.enableWebSocket = <%- enableWebSocket %>;
1010
</script>
11-
<script src="../dist/client.js" defer></script>
11+
<script src="/dist/client.js" defer></script>
1212
</head>
1313
<body>
1414
<main>

0 commit comments

Comments
 (0)