A Mantine theme object based on the Nord palette. (Light・Dark)
# With yarn
yarn add @yungerdev/theme
# With npm
npm install @yungerdev/theme
Basic usage
import { MantineProvider } from "@mantine/core";
import { theme } from "@yungerdev/theme";
function Demo() {
return (
<MantineProvider theme={theme} withGlobalStyles withNormalizeCSS>
<App />
</MantineProvider>
);
}
Additional styles can be provided under the MantineProvider
import { MantineProvider } from "@mantine/core";
import { theme, Scrollbar, TextSelection } from "@yungerdev/theme";
function Demo() {
return (
<MantineProvider theme={theme} withGlobalStyles withNormalizeCSS>
<Scrollbar />
<TextSelection />
<App />
</MantineProvider>
);
}
With a custom colorScheme
and ColorSchemeProvider
import { useState } from "react";
import { MantineProvider, ColorSchemeProvider, ColorScheme } from "@mantine/core";
import { theme } from "@yungerdev/theme";
function Demo() {
const [colorScheme, setColorScheme] = useState<ColorScheme>("light");
const toggleColorScheme = (value?: ColorScheme) =>
setColorScheme(value || (colorScheme === "dark" ? "light" : "dark"));
return (
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={toggleColorScheme}>
<MantineProvider theme={{ ...theme, colorScheme }} withGlobalStyles withNormalizeCSS>
<App />
</MantineProvider>
</ColorSchemeProvider>
);
}
MIT