@fefade/svelte
Version:
Reusable Svelte UI components powered by the FEFADE core system.
16 lines (15 loc) • 474 B
JavaScript
import { themeConfigState } from "../states/index.js";
import { providerUtil } from "@fefade/core/utils";
export default function themeConfigUtil() {
const themeConfig = themeConfigState();
const { toggleThemeMode } = providerUtil();
return {
colors: themeConfig.getColors(),
mode: themeConfig.getMode(),
toggle: () => {
toggleThemeMode((t) => {
themeConfig.setThemeMode(t);
});
}
};
}