Theme switcher for websites
npm install @anmiles/theme-switcherTheme switcher for websites
----
1. Install package:
``bash`
npm install @anmiles/theme-switcher
2. Import component:
`ts`
import { ThemeSwitcher } from '@anmiles/theme-switcher';
3. Use component:
`ts`
float
where
- _(optional)_ - position of icon and dropdown box
1. Install package:
`bash`
npm install @anmiles/theme-switcher
2. Copy all files from dist into the target website.
4. Create HTML container for theme switcher:
`html`
5. Include React library and theme switcher:
### Development
`html`
### Production
`html`
6. Place theme switcher into container:
`html`
float
where
- _(optional)_ - position of icon and dropdown box
Use selectors to write theme-specific styles:
`css`
body[data-theme="light"] .selector {
/ css rules /
}
`css`
body[data-theme="dark"] .selector {
/ css rules /
}
Or you can just write default styles for light theme and override them for dark theme using body[data-theme="dark"]`.