Skip to content

Commit c0b172e

Browse files
committed
fix: theme changer to using npmcdn css instead of local css file
1 parent a0fb863 commit c0b172e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-flatpickr-plus",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Flatpickr is a lightweight and powerful datetime picker. Svelte Flatpickr Plus is a wrapper for Flatpickr with some extra features.",
55
"homepage": "https://github.com/kodaicoder/svelte-flatpickr-plus",
66
"bugs": {

src/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ export async function themeChanger(themeName) {
4040
}
4141

4242
// Construct the potential theme path
43-
const themePath = `/node_modules/flatpickr_plus/dist/themes/`;
43+
const themePath = `https://npmcdn.com/flatpickr/dist/themes/`;
4444

4545
tc(themeName, themePath);
4646
}
4747
export function currentTheme() {
48-
const themePath = `/node_modules/flatpickr_plus/dist/themes/`;
48+
const themePath = `https://npmcdn.com/flatpickr/dist/themes/`;
4949
return getCurrentThemeName(themePath);
5050
}

src/lib/themeChanger.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default async function themeChanger(
1818
links.forEach((link) => link.remove());
1919
}
2020
linkElement.rel = "stylesheet";
21+
linkElement.type = "text/css";
2122
linkElement.href = pathToThemeFolder + name + ".css";
2223
document.head.appendChild(linkElement);
2324
}

0 commit comments

Comments
 (0)