A lightweight yet powerful solution to support multiple color schemes in your Svelte/SvelteKit application.
sthemer is a lightweight yet powerful solution for supporting multiple color schemes in Svelte and SvelteKit applications. It offers advantages such as being lightweight, powerful, easy to use, fast and efficient, and supporting both nested schemes and server-side rendering. It also has excellent TypeScript support, but also works with JavaScript projects.
To install sthemer as a dependency:
npm install sthemer
svelte.config.js file:// svelte.config.js
import { mixins } from 'svelte-preprocess';
module.exports = {
preprocess: [
mixins([
// Add the style mixin globally
require('sthemer/mixins/style')()
])
]
};
Sthemer.svelte component and define your preferred strategy:<!-- App.svelte or __layout.svelte -->
<script>
import { Sthemer } from 'sthemer';
</script>
<Sthemer strategy="auto">
<!-- Define styles for your components -->
</Sthemer>
sthemer is a lightweight and powerful solution for managing multiple color schemes in Svelte and SvelteKit applications. It offers easy installation and usage, with features such as support for nested schemes, server-side rendering, and excellent TypeScript support. With sthemer, developers can efficiently customize and implement color schemes to enhance the user experience of their applications.