Skip to content

Commit

Permalink
fix: theme changer to using npmcdn css instead of local css file
Browse files Browse the repository at this point in the history
  • Loading branch information
nutchyleo committed Dec 17, 2024
1 parent a0fb863 commit c0b172e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelte-flatpickr-plus",
"version": "2.0.0",
"version": "2.0.1",
"description": "Flatpickr is a lightweight and powerful datetime picker. Svelte Flatpickr Plus is a wrapper for Flatpickr with some extra features.",
"homepage": "https://github.com/kodaicoder/svelte-flatpickr-plus",
"bugs": {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export async function themeChanger(themeName) {
}

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

tc(themeName, themePath);
}
export function currentTheme() {
const themePath = `/node_modules/flatpickr_plus/dist/themes/`;
const themePath = `https://npmcdn.com/flatpickr/dist/themes/`;
return getCurrentThemeName(themePath);
}
1 change: 1 addition & 0 deletions src/lib/themeChanger.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default async function themeChanger(
links.forEach((link) => link.remove());
}
linkElement.rel = "stylesheet";
linkElement.type = "text/css";
linkElement.href = pathToThemeFolder + name + ".css";
document.head.appendChild(linkElement);
}
Expand Down

0 comments on commit c0b172e

Please sign in to comment.