a simple three state switch for use with skeleton in svelte (it can be used without skeleton you will just need to change the skeleton specific default classes)
npm install svelte-skeleton-three-state-switch
add the svelte-skeleton-three-state-switch content to your tailwind.config.ts
like so
export default {
darkMode: 'class',
content: [
'./src/**/*.{html,js,svelte,ts}',
join(
require.resolve('svelte-skeleton-three-state-switch'),
'../**/*.{html,js,svelte,ts}'
),
...
],
theme: {
...
},
plugins: [
...
]
};
it can then be imported like anything else
import { ThreeStateSwitch } from 'svelte-skeleton-three-state-switch';
an example is avalable in the routes directory of this project
Once you've cloned the project and installed dependencies with npm install
(or pnpm install
or yarn
), start the development server with:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
Everything inside src/lib
is part of the library, everything inside src/routes
is a showcase.
To build your library:
npm run package
To create a production version of your showcase app:
npm run build
You can preview the production build with npm run preview
.
Go into the package.json
and give your package the desired name through the "name"
option.
To publish your library to npm:
npm publish