An abstraction for themes in your Remix app.
Remix Themes is an abstraction for themes in your Remix app. It provides a set of features that allow you to easily implement themes, including perfect dark mode, system setting synchronization, and prevention of flash on load. With Remix Themes, you can create a seamless and customizable theme experience for your users.
To install Remix Themes, follow these steps:
Create your session storage and create a themeSessionResolver.
Setup Remix Themes by adding the action route.
/routes/action/set-theme.ts with the provided content.Use the provided API to implement Remix Themes in your app.
ThemeProvider component:
specifiedTheme: The theme from the session storage.themeAction: The action name used to change the theme in the session storage.useTheme hook:
createThemeSessionResolver function:
getTheme: A function that returns the theme from the session storage.setTheme: A function that takes a theme name and sets it in the session storage.commit: A function that commits the session storage.PreventFlashOnWrongTheme component:
Remix Themes is a powerful tool that simplifies the implementation of themes in Remix apps. With features like perfect dark mode, system setting synchronization, and prevention of flash on load, Remix Themes allows developers to create a seamless and customizable theme experience for their users. By following the installation guide and utilizing the provided API, developers can easily integrate Remix Themes into their apps and provide a consistent and visually appealing theme experience.