npx degit "https://github.com/DogFoxX/electron-sveltekit-tailwind" "<folder-name>"
Change <folder-name>
to the directory (without <>) you wish to clone this repo into.
npm install
npm run dev
npm run build
npm run deploy
If deploying to github releases, change the token
inside electron-builder.json
to your github access token.
Make sure that electron-builder.json
is excluded in .gitignore
before deploying.
Alternatively, remove the token
property and set your github access token as an ENV variable.
Open a new bash terminal and run
export GH_TOKEN=YOURTOKEN
Inside the electron
folder you will find the preload.cjs
which contains some APIs that we use in this template.
theme.set(themeMode);
themeMode
: String "dark", "light" or "system"src/lib/css/theme-colors.css
theme.get();
Get the current theme mode from electron-storeframe: false
which means a custom titlebar with minimize, maximize and close is created as a Svelte component.mainWindow.toggleMax();
toggles the window to maximized or restoredmainWindow.minimze();
minimizes the windowmainWindow.close();
closes the window and exits the appmainWindow.getState();
returns a boolean. Used in the window resized event to check whether the window was maximized or not.