···11+<script>
22+ import Example from './Example.svelte';
33+</script>
44+55+# Theme Toggle
66+77+## Example
88+99+<Example />
1010+1111+## Usage
1212+1313+```svelte
1414+<script>
1515+ import { ThemeToggle } from '@foxui/core';
1616+</script>
1717+1818+<ThemeToggle />
1919+```
2020+2121+If this component is used anywhere on your site, the mode will default to system settings (if the user has not manually set the mode).
2222+2323+## Accessibility
2424+2525+- If javascript is disabled, the theme toggle will not be shown.
2626+2727+## Credits
2828+2929+Based on [mode-watcher](https://github.com/svecosystem/mode-watcher), also exports all functions and stores from the package.
···14141515Also add the `@tailwindcss/typography` and `@tailwindcss/forms` plugins.
16161717-## 2. Install all fox ui components by running:
1717+## 2. Install the core fox ui components by running:
18181919```bash
2020-npm install @foxui/all
2020+npm install @foxui/core
2121```
22222323## 3. Set theme variables in your `app.css`
···26262727```css
2828@source "../node_modules/@foxui";
2929+3030+@custom-variant dark (&:is(.dark *));
29313032@theme {
3133 --color-base-50: var(--color-zinc-50);
···58605961```svelte
6062<script>
6161- import { Button } from '@foxui/all';
6363+ import { Button } from '@foxui/core';
6264</script>
63656466<Button>Click me</Button>
···7274Simply install a package when you need it, or you can install all of them with:
73757476```bash
7575-npm install @foxui/all
7777+npm install @foxui/core @foxui/3d @foxui/colors @foxui/social @foxui/text @foxui/time @foxui/visual
7678```
77797880### Dark mode
79818080-This ui kit is designed to be used in both light and dark mode
8181-(and switch automatically depending on system settings).
8282-If you want to disable dark mode, add the following to your app.css:
8282+This ui kit is designed to be used in both light and dark mode, and can be used in the following ways:
8383+8484+1. light mode only (default), for dark mode only, add the `dark` class to the `html` element in your app.
8585+8686+2. Allow users to switch between modes using the [\<ThemeToggle /\>](/ui-kit/components/core/theme-toggle) component (before being pressed will default mode to system settings).
83878888+3. automatically chooses the mode based on the system settings, simply remove the following from your app.css:
8489```css
8590@custom-variant dark (&:is(.dark *));
8691```
87928888-Similarly you can disable light mode:
8989-9090-1. Add the above code to your app.css
9191-2. Add the `dark` class to the `html` element in your app.