Utilities for theming React websites.
- Automatically detect and listen for
prefers-color-scheme
. - Automatically change the
<meta name="theme-color">
tag. - Sets a
data-theme="dark|light"
attribute on thebody
tag.
Under your <RecoilRoot>
, add the <ThemeProvider>
component.
function App() {
return (
<RecoilRoot>
<ThemeProvider /> {/* <-- adds theme support */}
...
</RecoilRoot>
);
}
This requires the following packages:
- React
- Recoil
To release a new version, create and push a new tag in the format of v1.2.3
. The CI will automatically publish the packages with the version 1.2.3
.